program conchoid_of_nicomedes implicit none integer pgopen, i real x1(3600), x2(3600), r, theta, delta_theta, a, c, pi if (pgopen('/xwin').le.0) stop write(*,*) 'Please input a non-zero real numbers "a",and "c"' write(*,*) ' (ex. 0.5 2.0, it is the ratio a/c that matters) :' read(*,*) a, c pi = 3.14159268 delta_theta = 2*pi/3600 do i=1, 3600 theta = (i-1)*delta_theta r = a/cos(theta) + c x1(i)=r*cos(theta) x2(i)=r*sin(theta) end do call pgenv(-4.0,4.0,-4.0,4.0,1,0) call pglab('x1','x2','Conchoid of Nicomedes') call pgline(3600,x1,x2) call pgclos end