|
-
February 24th, 2004, 02:08 PM
#3
Hi, I'm not sure I've seen that equation before.
Usually for drawing a circle I use this equation:
sx = x + radius * sin(i);
sy = y + radius * cos(i);
where
(x, y) is the center of the circle
radius is the radius of the circle
i is the running angle (0 - 180 degrees for half circle)
(sx, sy) is the running pixel coordinate
and use i as the loop counter.
Note that in JavaScript's Math.sin() and Math.cos(), angle is expressed in radians instead of degrees, so you need to convert degrees to radians with this equation:
radian = degree * PI / 180
Hope this helps.
Peace always,
<jdenny>
Always listen to experts. They\'ll tell you what can\'t be done and why. Then go and do it. -- Robert Heinlein
I\'m basically a very lazy person who likes to get credit for things other people actually do. -- Linus Torvalds
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
|
|