<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.4630.0">
<TITLE>3d plot - rotation of a point (x,y,z) via RotX,RotY,RotZ</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Arial">Hi,</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I hope someone can help me with this, but I am a bit stuck</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I am using two coordinate systems, </FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">1) The first is the normal OXYZ cartesian system which I setup as </FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">\pstThreeDCoor[nameX=$x_{0}$,nameY=$y_{0}$,nameZ=$z_{0}$,xMin=0,yMin=0,zMin=0,xMax=4,yMax=5,zMax=6] </FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I name this system : ORIGINAL</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">2) The second is the rotated system OX'Y'Z' with the same origin but setup as </FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">\pstThreeDCoor[<B>RotX=30,RotY=-15,RotZ=50</B>,nameX=$x$,nameY=$y$,nameZ=$z$,xMin=0,yMin=0,zMin=0,xMax=25,yMax=4,zMax=6]</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I name this system : ROT</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">In system ORIGINAL I draw a line from the origin to the point (0,0,z) with e.g z = 3</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">In system ROT I also draw a line from the origin to the point (0,0,z' ) with z' = 3 (via \psset{RotX=30,RotY=-15,RotZ=50}&nbsp; and \pstThreeDLine )</FONT></P>

<P><B><FONT SIZE=2 FACE="Arial">Question :</FONT></B>
</P>

<P><FONT SIZE=2 FACE="Arial">I want to find the coordinates (x,y,z) in system ORIGINAL for a point (x',y',z') in system ROT </FONT>
</P>

<P><B><FONT SIZE=2 FACE="Arial">Example</FONT></B>
</P>

<P><FONT SIZE=2 FACE="Arial">in system ROT I have the point (x',y',z' ) = (0,0,3), but what are its coordinates (x,y,z) in system ORIGINAL</FONT>
</P>

<P><B><FONT SIZE=2 FACE="Arial">Test I did</FONT></B>
</P>

<P><FONT SIZE=2 FACE="Arial">I tried to use the standard 3D rotation matrices I know, and try to map this to the pst-3dplot where the rotation matrix M is used.</FONT></P>

<P><FONT SIZE=2 FACE="Arial">What I cannot figure out is the order in which the rotation operations are done. What I mean is, is that in</FONT>

<BR><FONT SIZE=2 FACE="Arial">the call to \pstThreeDCoor[</FONT><B><FONT SIZE=2 FACE="Arial">RotX=30,RotY=-15,RotZ=50</FONT></B><FONT SIZE=2 FACE="Arial">, ...... I cannot determine what the rotation sequence is </FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">RotX, RotY , RotZ&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; or</FONT>

<BR><FONT SIZE=2 FACE="Arial">RotZ, RotY, RotX&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; or</FONT>

<BR><FONT SIZE=2 FACE="Arial">RotY, RotZ, RotX&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; etc</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I also used consequent calls to </FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">\pstRotPointIIID[RotX=30](0,0,3){\xvalb}{\yvalb}{\zvalb}</FONT>

<BR><FONT SIZE=2 FACE="Arial">\pstRotPointIIID[RotY=-15](\xvalb,\yvalb,\zvalb){\xvalb}{\yvalb}{\zvalb}</FONT>

<BR><FONT SIZE=2 FACE="Arial">\pstRotPointIIID[RotZ=50](\xvalb,\yvalb,\zvalb){\xvalb}{\yvalb}{\zvalb}</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">to find the coordinates in this way, but no success so far</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">The rotation matrices I use are (sort of in mathematica notation)</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Rotation Z-axes = </FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">(&nbsp; Cos[alpha]&nbsp; Sin[alpha]&nbsp;&nbsp; 0</FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT SIZE=2 FACE="Arial"> Sin[alpha]&nbsp; Cos[alpha]&nbsp; 0</FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT SIZE=2 FACE="Arial"> 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 )</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">with alpha = RotZ</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Rotation X&nbsp; axes = </FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">(&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 </FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cos[gamma] -Sin[gamma]</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sin[gamma]&nbsp;&nbsp;&nbsp; Cos[gamma] )</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">with gamma = RotX</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Rotation Y axes = </FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">(&nbsp; Sin[beta]&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cos[beta]</FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0</FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">Cos[beta]&nbsp; 0,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sin[beta] )</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">with beta = RotY</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Thanks in advance for all the help</FONT>

<BR><FONT SIZE=2 FACE="Arial">Kind regards</FONT>

<BR><FONT SIZE=2 FACE="Arial">Wim Neimeijer</FONT>
</P>

</BODY>
</HTML>