clc; clear all;

%cylindrical to cartesian
rho = 3.162;
phi = 71.56;
z = 5;

P_cyl = [rho phi z] 

x = rho.*cosd(phi);
y = rho.*sind(phi);

P_car = [x y z]

%spherical to cartesian
r = 5.916;
theta = 71.56;
phi = 32.31;

P_sph = [r theta phi]

x = r.*sind(phi).*cosd(theta);
y = r.*sind(phi).*sind(theta);
z = r.*cosd(phi);

P_car2 = [x y z]

