Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic MIDDLE POINT. (Read 1360 times)
alesdario
Junior Member
**
Offline



Posts: 71
Joined: Mar 7th, 2007
MIDDLE POINT.
Mar 9th, 2007 at 2:42pm
Print Post  
Hi.
I look for calculate a middle point of bezier' curve.
To calculate middle point of a straight bezier' arrow i used the metod you wrote me yesterday.
But now, i need to calculate middle point of a Bezier Curve (not straight). Is it possible?
Please, reply me "YES"!  Smiley

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: MIDDLE POINT.
Reply #1 - Mar 9th, 2007 at 6:45pm
Print Post  
Hi,

You will find a point lying on the curve somewhere near the center by calculating the Bezier formula with the t parameter set to 0.5:

x(t) = (1-t)^3 x0 + 3t(1-t)^2 x1 + 3t^2 (1-t) x2 + t^3 x3
y(t) = (1-t)^3 y0 + 3t(1-t)^2 y1 + 3t^2 (1-t) y2 + t^3 y3

Xi and Yi above are the control points in a Bezier segment.

If you have more than one segment, you can do that calculation for the middle segment when there are odd number of segments, or just take the middle control point when there are even number of segment.

That won't find the ideal middle point, but at least the point will lie on the Bezier curve. Finding the ideal middle point for a Bezier involves some calculus and solving integrals  Shocked

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint