This program converts 3 dimensional spherical coordinates, (r, theta, phi), to rectangular coordiantes, (x, y, 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).
X: x
Y: y
Z: z
Stack | Before | After |
---|---|---|
t | - | - (unchanged) |
z | phi | z |
y | theta | y |
x | r | x |
No registers and flags are used.
To convert rectangular coordinates, (r, theta, phi) = (10, 30deg, 60deg) to rectangular coordinates,
60 ENTER 30 ENTER 10 ENTER XEQ "->XYZ" X: 2.5 Y: 4.33 Z: 8.66
LINE KEYS 00 { 13-Byte Prgm } 01 LBL "->XYZ" ; 02 ->REC ; (r, theta, phi, t) -> (z, r_xy, phi, t) 03 X<> ST T ; -> (t, r_xy, phi, z); Key in X<>, .(period), ST T 04 roll dn ; -> (r_xy, phi, z, t) 05 ->POL ; -> (x, y, z, t) 06 END ;
None