There is a procedure that draws a graph of the parametric function in the Cartesian system. Tell me how to remake for the polar system.
procedure paint_graphics(x0,y0,mx,my:integer); const t_start=0; t_end=20; dt=0.01; var t,x,y:real; xe,ye:integer; begin t:=t_start; repeat x:=f(t); y:=g(t); xe:=trunc(x0+x*mx); ye:=trunc(y0-y*my); PutPixel(xe,ye,5); t:=t+dt; until t>t_end; end;
he, ye - transfer to the screen coordinates. x0, y0 - the center. t varies from 0 to 20. mx; mu is the scale along the x and y axes.
Can anyone come across?
Now drawn like this:
And you need to:
Here are the functions themselves:
const gradus = 0; theta = Pi / 180 * gradus; function f(t:real):real; begin f:=cos(2*t)*cos(theta)-t*sin(theta); end; function g(t:real):real; begin g:=t*cos(theta)+sin(t)*sin(theta); end;