Information and discussion about graphics, figures & tables in LaTeX documents.
coachbennett1981
Posts: 274 Joined: Fri Feb 05, 2010 10:15 pm
Post
by coachbennett1981 » Tue Feb 09, 2010 4:19 am
I found a great example of polar coordinates that are in degree mode. Is there a way I can change the degrees to radian measure? Here is the code.
Code: Select all
\begin{pspicture}(-3.5,-3.5)(3.5,3.5)
\psaxes[axesstyle=polar,subticklinestyle=dashed,subticks=2,labelFontSize=\scriptstyle](3,3)
\psplot[polarplot,algebraic,linecolor=red,linewidth=2pt,plotpoints=2000]{0}{TwoPi}{6*sin(x)*cos(x)}
\end{pspicture}
NEW: TikZ book now 40% off at Amazon.com for a short time.
retrogrouch
Posts: 4 Joined: Tue Feb 09, 2010 9:43 am
Post
by retrogrouch » Tue Feb 09, 2010 9:56 am
You can calculate inside the parameters list so I'm guessing you could use something like 360*radians/(2*pi) in place of x. The manual goes into a lot of detail about calculations.
Laurie
localghost
Site Moderator
Posts: 9202 Joined: Fri Feb 02, 2007 12:06 pm
Post
by localghost » Tue Feb 09, 2010 10:41 am
What makes you think that the function is in degree mode? I think that a domain from 0 to 2*Pi already represents radians.
Best regards and welcome to the board
Thorsten
CrazyHorse
Posts: 351 Joined: Sat Aug 02, 2008 8:47 am
Post
by CrazyHorse » Tue Feb 09, 2010 10:56 am
With algebraic=true the angles are always in radian!
Herbert
coachbennett1981
Posts: 274 Joined: Fri Feb 05, 2010 10:15 pm
Post
by coachbennett1981 » Tue Feb 09, 2010 6:52 pm
Thanks for the replies from everyone. When you run the diagram each angle measure is in degree, I am wondering if it can be made to show the radians instead of the degree. I see the code 0 to 2*pi. I should have been more clear, I want to show the polar coordinate plane in radians, not degrees, I was not talking about the function given.
Thank you
Nick
CrazyHorse
Posts: 351 Joined: Sat Aug 02, 2008 8:47 am
Post
by CrazyHorse » Tue Feb 09, 2010 8:32 pm
A quick hack ...
Code: Select all
\documentclass{article}
\usepackage{pstricks-add}
\def\psvlabel#1{%
\ifnum#1=30 $\frac{\pi}{6}$\else
\ifnum#1=180 $\pi$\else
\ifnum#1=360 $2\pi$\else
\pstFPDiv\Val{#1}{30}$\frac{\Val\pi}{6}$%
\fi\fi\fi}
\begin{document}
\begin{pspicture}(-3.5,-3.5)(3.5,3.5)
\psaxes[axesstyle=polar,subticklinestyle=dashed,subticks=2,labelFontSize=\scriptstyle](3,3)
\psplot[polarplot,algebraic,linecolor=red,linewidth=2pt,plotpoints=2000]{0}{TwoPi}{6*sin(x)*cos(x)}
\end{pspicture}
\end{document}
Herbert
nftaussig
Posts: 2 Joined: Fri Jan 18, 2013 3:18 pm
Post
by nftaussig » Fri Jan 18, 2013 3:26 pm
You can modify Herbert's code to get the radian measures in reduced form as follows.
Code: Select all
\documentclass{article}
\usepackage{pstricks-add}
\def\psvlabel#1{%
\ifnum#1=30 $\frac{\pi}{6}$\else
\ifnum#1=60 $\frac{\pi}{3}$\else
\ifnum#1=90 $\frac{\pi}{2}$\else
\ifnum#1=120 $\frac{2\pi}{3}$\else
\ifnum#1=180 $\pi$\else
\ifnum#1=240 $\frac{4\pi}{3}$\else
\ifnum#1=270 $\frac{3\pi}{2}$\else
\ifnum#1=300 $\frac{5\pi}{3}$\else
\ifnum#1=360 $2\pi$\else
\pstFPDiv\Val{#1}{30}$\frac{\Val\pi}{6}$%
\fi\fi\fi\fi\fi\fi\fi\fi\fi}
\begin{figure}
\begin{center}
\begin{document}
\begin{pspicture}(-3.5,-3.5)(3.5,3.5)
\psaxes[axesstyle=polar,subticklinestyle=dashed,
subticks=2,labelFontSize=\scriptstyle](3,3)
\psplot[polarplot,algebraic,linecolor=red,
linewidth=2pt,plotpoints=2000]{0}{TwoPi}{6*sin(x)*cos(x)}
\end{pspicture}
\end{center}
\caption{$r(\theta) = 6\sin\theta\cos\theta$.}
\end{figure}
\end{document}
Attachments
polar_graph_with_coordinates_in_radians.pdf
Output for polar graph with coordinates in radians. (26.3 KiB) Downloaded 379 times
Last edited by
Stefan Kottwitz on Fri Jan 18, 2013 3:45 pm, edited 1 time in total.
nftaussig
Posts: 2 Joined: Fri Jan 18, 2013 3:18 pm
Post
by nftaussig » Thu Sep 19, 2013 3:11 pm
After reviewing my previous post, I realized that I made an error. The corrected version follows.
Code: Select all
\documentclass{article}
\usepackage{pstricks-add}
\def\psvlabel#1{%
\ifnum#1=30 $\frac{\pi}{6}$\else
\ifnum#1=60 $\frac{\pi}{3}$\else
\ifnum#1=90 $\frac{\pi}{2}$\else
\ifnum#1=120 $\frac{2\pi}{3}$\else
\ifnum#1=180 $\pi$\else
\ifnum#1=240 $\frac{4\pi}{3}$\else
\ifnum#1=270 $\frac{3\pi}{2}$\else
\ifnum#1=300 $\frac{5\pi}{3}$\else
\ifnum#1=360 $2\pi$\else
\pstFPDiv\Val{#1}{30}$\frac{\Val\pi}{6}$%
\fi\fi\fi\fi\fi\fi\fi\fi\fi}
\begin{document}
\begin{figure}[h]
\begin{center}
\begin{pspicture}(-3.5,-3.5)(3.5,3.5)
\psaxes[axesstyle=polar,subticklinestyle=dashed,
subticks=2,labelFontSize=\scriptstyle](3,3)
\psplot[polarplot,algebraic,linecolor=red,
linewidth=2pt,plotpoints=2000]{0}{TwoPi}{6*sin(x)*cos(x)}
\end{pspicture}
\end{center}
\end{figure}
\end{document}
Attachments
polar_graph_with_coordinates_in_radians.pdf
polar graph with coordinates in radians (26.1 KiB) Downloaded 324 times