I've seen that some folks who pay attention to this list, also happen to be 
relatively comfortable with the math of Bezier curves.

Suppose we have a path, P (involving a cubic Bezier : d="M x y C cx cy dx dy ex 
ey"), then we can use P.getPointAtLength(P.getTotalLength()/2) to get the point 
which is halfway, in terms of arc length, from start to finish.  Let's call 
that point H.

We may also calculate a (usually) different point M, defined by a weighted 
average of the end points with the control points as shown in [1]. 

That M and H are both points on the curve follows from the midpoint theorem and 
from the definition of getPointAtLength() . That they need not be the same can 
be verified by inspection of  few examples.

I would be curious to know  the arc length [2] of the curve from (x,y) to M (so 
that I might figure out when a SMIL animation will actually pass that point).  
I can tell by looking at the form of the parametric equation integrated over a 
radical involving its derivative, that my calculus is way too many decades old 
to even begin to work on it. Since M is sort of a special point, its arc length 
may also be special.

Alternatively does anyone know where getPointAtLength is defined? I'm assuming 
it uses some numerical approximation? Is that function invertible (since I'd 
like to do just the opposite of what the JavaScript function does)?

Ultimately I'm interested in the length of the arc to M since I'd like to use 
it as a point at which to place a bud for a new sprout on a branch -- it is 
also a point of sort of maximum curvature so it seems like a likely point for a 
bud to happen in a biological system. I can resort to using H instead -- since 
I can find it easily and I can presumably differentiate the curve at the point 
H, so as to generate a new sprout at some given angle relative to its parent 
branch. But M just seems more interesting, being in the center of the action, 
so to speak.

David

[1] http://homepage.smc.edu/kennedy_john/BEZIER.PDF
[2] http://en.wikipedia.org/wiki/Arc_length

[Non-text portions of this message have been removed]


------------------------------------

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
----Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to