Calculating Point on oval

BlitzMax Forums/BlitzMax Programming/Calculating Point on oval

TomToad(Posted 2008) [#1]
Basically I want to calculate the x,y offset based on angle, following an oval path. It's easy with circles:
X = Cos(Angle)*Radius
Y = Sin(Angle)*Radius

But it is more difficult with ovals since the radius changes as you go around. Basically, the oval is 200x150 pixels. So at 0 degress, you are at 100,0, 90 degrees would be 0,75. 180 would be -100,0 and 270 would be 0,-75.


GfK(Posted 2008) [#2]
You just use a different radius for Y; 75 in this case.


ziggy(Posted 2008) [#3]
I think TomToad is asking for a formula to get the radious of an oval from a given arbitrary angle. I can't remember right now, but I think it was something like the radious of the small circle multiplied by the sin plus the radious of the big circle multiplied by the cos or something like that... ?


TomToad(Posted 2008) [#4]
Thanks. That worked perfectly.


TomToad(Posted 2008) [#5]
ziggy: Gfk got what I needed. However, once you get the x,y coordinates, The radius is easy to figure out with Sqr(x^2+y^2).