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.
We can produce other geometric curves in the same way = PARAMETRIC EQUATIONS
Fig. 12.1 : (a). Circle.
Fig. 12.2 : (b). Circle?