Now we come to draw a cardioid. The function of a cardioid in polar coordinate reads "r=a(1+sin(x))". And we take a=1.5.
\documentclass{article} \usepackage{pstricks} \usepackage{pstricks-add} \usepackage{pst-plot} \begin{document} \psset{plotpoints=500} \begin{psgraph}{->}(0,0)(-0.5,-2)(3.5,2.5){5cm}{5cm} \psplot[polarplot=true]{0}{360} {x cos 1 add 1.5 mul} \end{psgraph} \end{document}
Fig.1 Plot in polar coordinate --- cardioid. |
The axesstyle can also be set to polar. The only thing need to do is setting "axesstyle=polar". This time we use a three-leaved rose curve (r=a*sin(3x),a=3.5) to shown it.
\documentclass{article} \usepackage{pstricks} \usepackage{pstricks-add} \usepackage{pst-plot} \begin{document} \psset{plotpoints=500} \begin{pspicture}(-4,-4)(4,4) \psaxes[axesstyle=polar,xAxisLabel=some, subticks=2,tickcolor=red,tickwidth=1pt, subtickcolor=green]{->}(0,0)(-4,4)(4,4) \psplot[polarplot=true,linewidth=2pt, linecolor=blue]{0}{360} {3 x mul sin 3.5 mul} \end{pspicture} \end{document}
Fig.2 Plot in polar coordinate — three leaved rose curve. |
Files Download: tex ps pdf