[pstricks] 3d circle around a line

Herbert Voss LaTeX at zedat.fu-berlin.de
Tue Dec 13 14:15:12 CET 2005


Joel Salomon wrote:
> I'm trying to create a diagram for a paper on MRI, showing the
> precession of a "spining" proton about the B₀ field — something like
> <http://www.medinus.co.kr/special/mri01.files/image016.jpg>.  Here's
> the code I have so far:

it is not a good idea, choosing Beta=0, then there is
no real 3d-view.

However, you can rotate objects with the default \rput macro

Herbert

\documentclass{article}
\usepackage{amssymb,pst-3dplot}
\begin{document}
\pagestyle{empty}
\begin{pspicture}(-3,-3)(3,3)%\psgrid
   \pstThreeDCoor[%
     xMin=-3.5,xMax=3.5,%
     yMin=-3.5,yMax=3.5,%
     zMin=-3,zMax=3,%
     Alpha=45,Beta=0]
   \pstThreeDLine[linewidth=1pt,linecolor=blue,arrows=->]%
	(-1.06,1.06,-2.5)(1.06,-1.06,2.5)
   \pstThreeDPut(1.2,-1.2,2.6){\blue $\vec\mu$}
   \pstThreeDCircle(0,0,-2.5)(1.5,0,0)(0,1.5,0)
   \pstThreeDLine[linewidth=2pt,linecolor=blue](0,0,-3)(0,0,-1.5)
%	\pstThreeDCircle[beginAngle=0,endAngle=90]%
%		(0,0,0)(0,0,0)(0,0,0)
   \rput{30}(0,0){%
     \pstThreeDSphere[Beta=0,linecolor={[cmyk]{0.2,0.6,1,0}},linewidth=0pt,%
	SegmentColor={[cmyk]{0.2,0.6,1,0}}](0,0,0){1.5}
     \pstThreeDCircle(0,0,-2.5)(1.5,0,0)(0,1.5,0)
     \pstThreeDCircle(0,0,2.5)(1.5,0,0)(0,1.5,0)}
   \pstThreeDLine[linewidth=2pt,linecolor=blue,arrows=->](0,0,1.5)(0,0,3)
   \pstThreeDPut(-.2,.2,3){\blue $\vec B_0$}
   \pstThreeDCircle(0,0,2.5)(1.5,0,0)(0,1.5,0)
\end{pspicture}
\end{document}





More information about the PSTricks mailing list