-
Radius
If I draw a circle on a form, how would I be able to find the X, Y (Better yet, TOP, LEFT) of a particular point on the circle? I would like to animate something following that path, but I don't remember geometry very well and don't know exactly how to convert that point to coordinates on the form.
-
Divide the circle into 4 quadrants.
Using the radius of the circle as the hypotenuse of a right
triangle, use trig to calculate cos & sin distances.
Add or subtract these distances (depending on the quadrant)
to the center of circle coordinates.:D
Good luck
-
well...
...we don't exactly understand what you mean.
points (x,y) on a circle satisfy the equation:
x^2 + y^2 = r^2
where r is the radius of the circle.
If you are trying to animate something then:
1. Draw the circle
2. Find its radius somehow (I assume you can work this out from the co-ords when you draw the circle)
3. Let x range from lowest value to highest value and solve for y.
-
Heres one way:
Given Radius Ro, Origion Xo, Yo, and you want to find Xn, Yn, at angle Ang, then:
Xn = Xo + Ro*Cos(Ang)
Yn = Yo + Ro*Sin(Ang)
And, if you use radians, you get a complete circle as Ang goes from 0 to 2*pi.
-Hope this helps
-Lou