# Thread: Approximate Bezier Curve Length

1. ## Approximate Bezier Curve Length

Hi,
We're now in the final stages of product completion and need to address a couple of minor tweaks. We use bezier curves to define many of our object trajectories ... but we use linear interpolation based on the origin to destination ... and for 95% of the time the effect is fine. However for short 'as the crow flies' trajectories, there is a significant difference between the actual curve distance.

Is there a way in which we could derive an very rough approximation of the bezier path length ?

Whilst our maths isn't too bad ... we'd appreciate responses that are more practical and maybe not those from the academic world !

We use a bezier definition of StartPoint, ControlPoint1, ControlPoint2 and EndPoint - all defined as Vectors.

Many thanks

Andrew

2. ## Re: Approximate Bezier Curve Length

i don't know of any "rough approximations" to the arc length of a bezier curve, but you could just use the standard integration method. go here , and take a look at the pdfs titled "moving at constant speed" and "numerical integration".

3. ## Re: Approximate Bezier Curve Length

Many thanks for the link ... if nothing else I've now got a lot of reading to do ... there's some really good information here.

With regard to my original problem, I came up with something that works OK for my case ...

function BezierLength : GLfloat;
// Rough approximation for the bezier path length.
var
LinearLength : GLfloat;
begin
with fBezier do begin
LinearLength := VectorLength(VectorSubtract(StartPoint, EndPoint));
Result := (VectorLength(VectorSubtract(StartPoint, ControlPoint1)) +
VectorLength(VectorSubtract(EndPoint, ControlPoint2))) / 1.5;
if (Result < LinearLength) then
Result := LinearLength;
end; {with}
end; {BezierLength}

Andrew

[This message has been edited by Andrew Jameson (edited 04-27-2003).]

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•