Loading...
Logo
Processing Forum
I have a project where 3 points, in 2D, are known and one would need to draw a rotated ellipse through those tree points. Although it is quite common problem, I can't find anything on Wikipedia or Google. Basically, it is a section through a sphere, while section plane is not parallel to XYZ, but can be anything.

I looked into Bezier curves, but, while I can match 2 points easily, there I do not know how to hit the 3rd point that is right in the middle.

Does anybody knows an equation that will do that?




Replies(2)

I was about to post a link to circumscribed circles (circles made by polygons- in your case a circle described by the three points of a triangle: http://en.wikipedia.org/wiki/Circumscribed_circle#Circumscribed_circles_of_triangles) but then I realized you are looking to create an ellipse. Three points are insufficient to describe an ellipse- you need a bit more information (for example, the focus or center point).

If the center point of the ellipse is the center point of the sphere, you might have enough to find it. Refer to this:  http://stackoverflow.com/questions/197649/how-to-calculate-center-of-an-ellipse-by-two-points-and-radius-sizes

I won't purport to be a mathematician... that's about all I can help you with! Also, give stack overflow a search- it's good for these sorts of geometry problems.

-kyle
Yeah, the easiest way to do it was with built in functions pushMatrix() and popMatrix(). Strange as they are, these functions store coordinate system transformations in a stack.