Drawing an arc

newbie
02-23-2005, 11:53 AM
Hi,

I'd like to draw an arc from A path attribute using flash Drawing API.(curveTo)
Till now I could draw quadratic and cubic bezier curves, so I thought an arc can be drawn as a cubic bezier curve knowing start and end points , but the A attribue doesn't provide control points for the cubic curve to be drawn.

How can I calculate the control points ?

If there was an easier solution please tell .

Thanx

Anonymous
02-23-2005, 05:34 PM
You can look at
http://wiki.svg.org/index.php/ThePath

With a cubic, control points are on tangents to circle for end and begin points.
You write that middle of Bezier cubic is on circle and you get position for control points.

Of course, you get not exactly a circle but for human eye, it's a circle ....

Michel

newbie
02-26-2005, 10:28 AM
I'm not shure I got this right!

Maybe I wasn't clear.

First what I mean with control points is the 2 handles that streches the curve , not the start and end point which are provided by the "A" attribute already. (and its previous command).

I meant : if I had the start and the end points and the way to draw a cubic bezier.
Then all I need to know is those 2 handle points, (right?) knowing the angle of inclination of the ellipse and its rx and ry.

Next I pass the start point,end point ,first handle, second handle to the cubic bezier function and that's it.

drawCubicBezier(P0,P1,P2,P3) ; //for example

Hope I'm clear.

Off topic:
Does anyone see the spam threads ? I wonder why till now nobody removed them.

 
Web mp2kmag.com
mapforums.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum