More math than anything...
I was wondering what formula I can use to find arbitraty points on a circle. I am hoping to have a keyboard controlled light move around a circle, but the only circle formulae I know are for perimeter and area. Any help would be appreciated.
Any point on a circle can be represented in (x,y) as (RcosA, RsinA) where A is the angle and R is the radius of the circle.
Hope that helps...
S.
Hope that helps...
S.
use the maths functions sin() and cos()
they take an argument in radians (there are 2*PI radians in a circle) and sin will return the x, cos will return the y position of an angle on the x plane made with a circle with a radious of one unit
e.g.
for(int angle=0;angle<(2*PI);angle+=0.1f)
{
x=sin(angle);
y=cos(angle);
draw(x,y);
}
.. i hope u get the idea
they take an argument in radians (there are 2*PI radians in a circle) and sin will return the x, cos will return the y position of an angle on the x plane made with a circle with a radious of one unit
e.g.
for(int angle=0;angle<(2*PI);angle+=0.1f)
{
x=sin(angle);
y=cos(angle);
draw(x,y);
}
.. i hope u get the idea
equation of a circle:
r^2 = (x - x1)^2 + (y - y1)^2
where (x1, y1) is the centre of ur circle
Quantum, i think u've got ur x and y around the wrong way - y=sin(angle);
x=cos(angle);
Edited by - kwall on September 9, 2000 10:22:43 PM
r^2 = (x - x1)^2 + (y - y1)^2
where (x1, y1) is the centre of ur circle
Quantum, i think u've got ur x and y around the wrong way - y=sin(angle);
x=cos(angle);
Edited by - kwall on September 9, 2000 10:22:43 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement