home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS - Coast to Coast
/
simteldosarchivecoasttocoast2.iso
/
calculat
/
sm30a.zip
/
POLAR.(X)
< prev
next >
Wrap
Text File
|
1993-11-12
|
585b
|
21 lines
# plot r=f(t) on polar plane.
# by default tmin:=0, tmax:=2*pi, rmin:=0, rmax:=10
# e.g. polar(1, t) # r=1
polar(r_, t_, tmin_, tmax_, rmin_, rmax_) := block(numeric:=on,
graph,
dt:=(tmax-tmin)/getmaxx,
tstep:=dt*10,
dr:=(rmax-rmin)/getmaxy,
getmaxx2:=getmaxx*0.5,
getmaxy2:=getmaxy*0.5,
moveto(getmaxx2,getmaxy2),
do( lineto(cos(t)*(r-rmin)/dt+getmaxx2,getmaxy2-(r-rmin)*sin(t)/dr),
t,tmin,tmax,tstep),
numeric:=off,
readchar,
text,
local(dt,dr,tstep))
polar(r_, t_, tmin_, tmax_) := polar(r,t,tmin,tmax,0,10)
polar(r_, t_) := polar(r,t,0,2*pi,0,10)