The Babylonians (approximately 2000 years BC) used the degree system to describe the process of turning around in a circle. Some people think they divided the circle into 360 equal parts because they divided one year into 360 days. Others believe the Babylonians knew that a chord equal in length to the radius can be laid off around a circle six times forming a regular 6-gon (hexagon) and that, since their notation for numbers was based on 60, they divided the arc subtended by each chord into 60 equal parts.
In the degree system, if you face in the direction of the x
-axis and then turn all the way round in a counter clockwise direction, you turn from 0o
to 360o
.
radius (r)=1
) with its centre at the origin (0,0
). What are the x
and y
coordinates of the point at the end of the radius a quarter of the way round the circle?360o
. The circumference of a circle is given by 2*PI*r
.
1o
in radians.1 radian
in degrees.22/7 = 3.14285 ... PI = 3.14159 ...Therefore, we should define
PI
at the beginning of our programs.
#define PI 3.14159
We can find the values of x1
and y1
, a point with distance r
from the origin (0,0)
, using the value of angle
according to the following.
x1 = r*cos(angle) y1 = r*sin(angle)
r=1
and angle=45o
, write down the the values of x1
and y1
in radians.A circle is the set of points in a plane such that each of those points is the same non-negative distance from a fixed point (the centre of the circle) on that plane.
x, y
coordinates of the points on a unit circle that we reach by turning from 0o
to 30o
, 60o
, and 140o
.x1, y1
, we can calculate x2, y2
according to the following.
x2 = x1 + r*cos(angle) y2 = x2 + r*sin(angle)
x1=y1=1.5
, angle=25o
, and r=2.5
, what are the values of x2
and y2
?
If x1,y1
is the centre of a circle, we can calculate the values of points lying on the circumference of the circle.
Here is a general algorithm for calculating the the x,y
values of a number of points (vertices) lying at equal distances around the circumference of that circle. Using this we can construct n-gons. If we have a large enough number of vertices, the n-gon approximates the circumference of a circle.
angle = 2 * PI / numVertices for(i=0;i<numVertices;i++){ nGon[i][x]=centreX+radius*cos(i*angle); nGon[i][y]=centreY+radius*sin(i*angle); }
x
and y
values of each vertex, placing them in an array. (The vertices in the array can be used later for rendering). 1 unit
, what is the length of each side of this shape?0o
to360o
.
0o
to180o
or from 45o
to135o
)