12.4. Curves   

What about curves? We can use many very small line segments, perhaps even points (= line segment of unit length with no orientation) to produce curves.


Example circle:
An arbitrary point (x,y) on circle of radius R and centre (0.0,0.0)
may be represented by vector pair:
(R*cos,R*sin)
where is angle that radius through
the point makes with x-axes. Hence increment from 0 to 360 in N-equal
increments produces N-gon = N sided equilateral polygon.
If N is large enough, looks like a circle.
program CIRCLE
call export(stdin,stdout); {Allow library to use stdio.}
call askdev(device);
input radius ;
call start(2);
call plot(9.5,7.375,-3); {centre circle }
call plot(radius,0.0,3); {move to radius of circle}
theta 0.0;
theta_inc 2*PI/100;
for i 1 to 100 do
theta theta + theta_inc;
call plot(radius*cos(theta),radius*sin(theta),2);
{draw to next point on circle radius}
endfor;
call enplot;
end_program_circle.

This produces the circle of Figure 12.2 a but if we mistakenly assume that sin and cos function take an argument in degrees rather than radians we get the star shaped image of Figure 12.2 b.

We can produce other geometric curves in the same way = PARAMETRIC EQUATIONS


    
(a). Circle.
Fig. 12.1 : (a). Circle.
    
(b). Circle?
Fig. 12.2 : (b). Circle?