
From:  Doug Stewart 
Subject:  Re: use of cart2sph not in line with manual 
Date:  Tue, 11 Feb 2020 14:05:23 0500 
Dear madam/sir,
I have been struggling with the function (theta,phi,R) = cart2sph(x,y,z) for some time and found out that
the description in the octave manual is not exactly in line with its behaviour.
But I found out that:
In the manual it is told that:
'theta represents the angle relative to the positive xaxis'
The angle relative to the positive xaxis is mathematically defined as the dotproduct of a position
vector r with the unitvector in the xdirection. This is in line with default mathematical representation
of spherical polar coordinates where theta represents the angle between position vector and unitvector z axis.
I assumed from the description in the manual that in Octave unit x took over the role of unit z, which apparently isn't.
Moreover, the angle phi is the elevation angle above the xyplane.
However, I found out that the angle theta using cart2sph is defined as the angle of the orthogonal projection
of position vector r onto the xy plane with the unitvector x.
This is in line with the definition of cart2sph in MatLab, where it is explicitly said that
theta represents the azimuth angle and phi the elevation angle.
This is in line with the description in the Octave manual.
It would be nice and less confusing if the words azimuth and elevation were used in this context, if possible with
a small graph.
Sincerely yours,
Dr. J.A. Piest
Nijmegen
The Netherlands
[Prev in Thread]  Current Thread  [Next in Thread] 