comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Range of "Spherical Coordinates" in SPHER_HARM
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Range of "Spherical Coordinates" in SPHER_HARM [message #62822] Sun, 12 October 2008 11:45 Go to next message
jameskuyper is currently offline  jameskuyper
Messages: 79
Registered: October 2007
Member
Karlo Janos wrote:
> Thanks for your comments!
> My confusion was caused by the contradictory statements about theta and
> phi.

What contradiction do you see within those statements?

> ... In my opinion/definition theta is the azimuthal angle (and _not_
> 'colatitudinal' as stated in the help document) and phi is the polar
> angle (and _not_ 'longitudinal').

That may be your opinion; but the definitions of theta and phi are
fundamentally arbitrary. There are conventions, of course, but different
conventions are followed by different groups.

I've got about 100 advanced math and physics books in my library. I just
did a quick survey of them, and 9 of them mention spherical coordinates
or spherical harmonics in the index. Here's my results:

Theta is azimuthal, phi is polar:
=================================
"Mathematical Analysis" - Apostol

Theta is polar, phi is azimuthal:
=================================
"Special Functions and their applications" - Lebedev
"Mathematical Methosds for Physicists" - Arfken
"Large Scale Structure of Spacetime" - Hawking & Ellis
"General Relativitiy" - Wald
"The Structure of Matter" - Gasiorowicz
"Quantum Mechanics" - Metzbacher
"Quantum Mechanics" - Messiah
"Gravitation" - Misner, Thorne, Wheeler
"Classical Electrodynamics" - Jackson
"Classical Electromagnetic Radiation" - Marion

You may work in a field where different conventions hold, but the
convention used by SPHER_HARM is at the very least a widely used convention.
Re: Range of "Spherical Coordinates" in SPHER_HARM [message #62824 is a reply to message #62822] Sun, 12 October 2008 04:41 Go to previous messageGo to next message
Karlo Janos is currently offline  Karlo Janos
Messages: 31
Registered: July 2008
Member
Thanks for your comments!
My confusion was caused by the contradictory statements about theta and
phi. In my opinion/definition theta is the azimuthal angle (and _not_
'colatitudinal' as stated in the help document) and phi is the polar
angle (and _not_ 'longitudinal'). Thus I was not sure, if SPHER_HARM
uses a different definition of the spherical coordinate system, because
theta cannot have a range of 2*pi when phi has (or the other way round)
- regardless of any symmetry.


> And, as is usually the case with IDL, the easiest
> approach is to try it and see if you get what you want.

I should remind this slogan more often.
Greets

Karlo
Re: Range of "Spherical Coordinates" in SPHER_HARM [message #62846 is a reply to message #62824] Thu, 09 October 2008 06:22 Go to previous messageGo to next message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <gcku0s$4t1$1@aioe.org>,
"Karlo Janos" <idl.20.beamer2@spamgourmet.com> wrote:

> Hello all!
>
> I am a little bit confused about the usage of spherical coordinates in
> the function SPHER_HARM.
> The first parameter should be the azimuthal angle theta (in the help
> document named 'polar' or 'colatitudinal') and the second parameter the
> polar angle phi (in the help document named 'azimuthal' or
> 'longitudinal').
> According to the example code at the end of the help page the range for
> theta seems to be [0; pi] as I would have presumed. But what is the
> range for phi? [0; 2pi] or [-pi; pi]? In some functions (where the
> keyword '/DEGREES' is possible) it must be the latter, relating to the
> coordinate system of the earth. But what about SPHER_HARM? I did not
> find any explanation about the definition of theta and phi there.
> Does anybody see clearly here?
> Greets
>
> Karlo

Spherical harmonics are simply sines and cosines in the azimuthal
(longitudinal) direction, so it does not matter whether you
use [0, 2 pi] or [-pi, pi]. Use whichever convention you want, but be
consistent or you will end up with phase errors.

And, as is usually the case with IDL, the easiest approach is to
try it and see if you get what you want.

Ken Bowman
Re: Range of "Spherical Coordinates" in SPHER_HARM [message #62851 is a reply to message #62846] Thu, 09 October 2008 10:18 Go to previous messageGo to next message
jameskuyper is currently offline  jameskuyper
Messages: 79
Registered: October 2007
Member
Karlo Janos wrote:
> Hello all!
>
> I am a little bit confused about the usage of spherical coordinates in
> the function SPHER_HARM.
> The first parameter should be the azimuthal angle theta (in the help
> document named 'polar' or 'colatitudinal') and the second parameter the
> polar angle phi (in the help document named 'azimuthal' or
> 'longitudinal').
> According to the example code at the end of the help page the range for
> theta seems to be [0; pi] as I would have presumed. But what is the
> range for phi? [0; 2pi] or [-pi; pi]? In some functions (where the
> keyword '/DEGREES' is possible) it must be the latter, relating to the
> coordinate system of the earth. But what about SPHER_HARM? I did not
> find any explanation about the definition of theta and phi there.

It is a fundamental feature of the spherical coordinate system that
theta and theta+2*!PI represent the same location, and similarly for
phi and phi+2*!PI. For this reason, the spherical harmonic functions
must show these same symmetries. It is no coincidence that that the
spherical harmonics are calculated by first calculating cos() and
sin() of theta and phi (or integer multiples thereof), and then using
those values for all subsequent calculations. There is therefore no
reason for SPHERE_HARM to impose any arbitrary limits on either theta
or phi, whether or not the /DEGREES option is turned on. I don't
believe that it imposes any such limits, my tests reveal none.
Re: Range of "Spherical Coordinates" in SPHER_HARM [message #62912 is a reply to message #62822] Mon, 13 October 2008 00:22 Go to previous message
Karlo Janos is currently offline  Karlo Janos
Messages: 31
Registered: July 2008
Member
> What contradiction do you see within those statements?

Well, I see much more clearly now.
I mixed up azimuth and elevation. Thus I thought azimuth is the angle
which defines the height above the x-y-plane. And hence I saw a
contradiction which is actually not there.


>> ... In my opinion/definition theta is the azimuthal angle (and not
>> 'colatitudinal' as stated in the help document) and phi is the polar
>> angle (and not 'longitudinal').
>
> That may be your opinion; but the definitions of theta and phi are
> fundamentally arbitrary. There are conventions, of course, but
> different conventions are followed by different groups.
>
> I've got about 100 advanced math and physics books in my library. I
> just did a quick survey of them, and 9 of them mention spherical
> coordinates or spherical harmonics in the index. Here's my results:
>
> Theta is azimuthal, phi is polar:
> =================================
> "Mathematical Analysis" - Apostol
>
> Theta is polar, phi is azimuthal:
> =================================
> "Special Functions and their applications" - Lebedev
> [...]

Of course I know these different conventions. And I always use the
latter one...

To come to a conclusion here: Thanks for helping me to find
clarification! :-)

Karlo
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: ARGHHHH Min_Curv_Surf !!!!!!!!!!!
Next Topic: large matrix operations

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:43:35 PDT 2025

Total time taken to generate the page: 0.00582 seconds