Hello all. This is probably a simple problem for you guys, but my geometry is a bit rusty and I am hoping that you can help.
I am trying to arrange an arbitrary number of objects around the circumference of an ellipse. My first stab at the problem resulted in the use of a simple rotational matrix like this (note that I am using graphical Cartesian coordinates where y increases down from the top of the screen).
def rotate(x, y, theta)
x_p = (x * Math.cos(theta)) - (y * Math.sin(theta))
y_p = (y * Math.cos(theta)) + (x * Math.sin(theta))
return [x_p, y_p]
end
That is obviously a circle, so I use the x coordinate and feed it into the equation of my ellipse to get the y(s).
This works and does what it is supposed to, but the problem is that I am only incrementing theta to find my points, so obviously they are not equidistant around the circumference of the ellipse. That is what I am after, and any help would be greatly appreciated.
You can find a description of the problem with pictures in this thread: