Illustrator: missing trigonometric functions to draw a circle segment?


is it possible to script a circle segment in Illustrator CS2? It should look like a cake but all I need is to build the curve path opposit the enclosed angle and the given midpoint. I can access two coordinates by their x/y-values (they are the outer values of the circle segment), also the coordinates of the midpoint and of course the given angle.
Since days, I am trying to influence the anchors of the two path points by their handlers to the left and the right, but all I get is far away from a nice circle. Also tried it with UIBrowser to address the menu item to draw a rounded path but this is always a 90 degree cake :wink: Easiest would be a thing like alpha=s/r for gradient measurement but I didn’t find any trigonometric hints in AS. Thank you guys a lot in advance.

I was trying to do a wholly unrelated thing in another script and someone pointed me to this:

It certainly helped me get the job done, although I don’t see any ellipse or circle functions in there. Maybe you could use it as a starting point?