|
-
Oct 17th, 2001, 07:25 AM
#1
Thread Starter
Hyperactive Member
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.
-
Oct 17th, 2001, 08:15 AM
#2
Member
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.
Good luck
-
Oct 17th, 2001, 08:16 AM
#3
Hyperactive Member
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.
There are 10 types of people in the world - those that understand binary, and those that don't.
-
Oct 17th, 2001, 10:02 AM
#4
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|