View Full Version : Calculate the angle of the circle with radius, URGENT!!!
03-30-2004, 05:52 PM
Is this the correct way to program to design a circle? I'm a bit confused.
Qns1: how you define the cos and sin? Do I create a variable called sine and cosine?
glVertex2f(450.0, cos(10.0*PI*360.0/180.0), 425.0, sin(10.0*PI*360.0/180.0));
Is this the correct way to program to design a circle?er, no, no it's not. your code wouldn't draw anything at all because you're defining a polygon but only providing one vertex. A polygon needs at least three vertices.
It is the right idea, though. You need to specify a set of vertices along the circumference of the circle. If you parameterise your cicle by angle in radians, then a unit circle is the set of points
... so, choose an arbitary number of points for your circle, divide 2pi radians into n pieces and compute the associated vertex.
Qns1: how you define the cos and sin?Taylor polynomials. Or you could use math.h :-)
Do I create a variable called sine and cosine?for what purpose?
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.