1

I have a Bezier Curve on an HTML5 Canvas and need to figure out the length of the curve. How can I do this easy?

Lets say :

var canvas = document.getElementById('myCanvas');
var context = canvas.getContext('2d');
context.beginPath();
context.moveTo(188, 130);
context.bezierCurveTo(140, 10, 388, 10, 388, 170);
context.lineWidth = 10;

How can I figure out the length of the curve I have created?

//T

1 Answers1

1

You'll have to find it mathematically, using the parameters you pushed in.

Use this reference: Calculate the length of a segment of a quadratic bezier

Community
  • 1
  • 1
Joban
  • 1,318
  • 7
  • 19