This program converts 3 dimensional rectangular coordinates, (x, y, z), to spherical coordiantes, (r, theta, phi).
X: x
Y: y
Z: z
X: r (radius)
Y: theta (polar angle)
Z: phi (azumuthal angle)
The angles are given in the units set by the current angular mode (degree/radian/gradian).
Stack | Before | After |
---|---|---|
t | - | - (unchanged) |
z | z | phi |
y | y | theta |
x | x | r |
No registers and flags are used.
To convert rectangular coordinates, (x,y,z) = (3, 4, 6.25) to spherical coordinates,
6.25 ENTER 4 ENTER 3 ENTER XEQ "->RTP" X: 8.00 (r: radius) Y: 38.66 (theta: polar angle) Z: 53.13 (phi: azumuth angle) (if in degree mode)
LINE KEYS 00 { 13-Byte Prgm } 01 LBL "->RTP" ; 02 ->POL ; (x,y,z,t) -> (r_xy, phi, z, t) 03 roll up ; -> (t, r_xy, phi, z) 04 X<> ST T ; -> (z, r_xy, phi, t); Key in X<>, .(period), ST T 05 ->POL ; -> (r, theta, phi, t) 06 END ;
None