Calculating Point on oval
BlitzMax Forums/BlitzMax Programming/Calculating Point on oval
| ||
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. |
| ||
You just use a different radius for Y; 75 in this case. |
| ||
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... ? |
| ||
Thanks. That worked perfectly. |
| ||
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). |