Re: CrossProduct in Spherical Coordinates

• To: mathgroup at smc.vnet.net
• Subject: [mg75342] Re: CrossProduct in Spherical Coordinates
• From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
• Date: Wed, 25 Apr 2007 05:45:43 -0400 (EDT)
• Organization: The Open University, Milton Keynes, UK
• References: <f0kbsf\$r1k\$1@smc.vnet.net>

gogoant06 at yahoo.com.hk wrote:
> Dear all,
>
> I am really new to mathematica and I have met a damn simple problem.
>
> In[1]:=
> <<Calculus`VectorAnalysis`
>
> In[2]:=
> CrossProduct[{1,0,0},{0,1,0},Spherical]

Here you tell Mathematica that _the given vectors are expressed_ in
spherical coordinates. You are not asking Mathematica to convert from
one system of coordinates (which one?) to spherical coordinates.

> Out[2]=
> {0,0,0}
>
> Why? Isn't the result supposed to be {0,0,1}, even in spherical
> coordinates?

No. The point (0, 0, 1) in Cartesian coordinates is (1, 0, 0) in
spherical coordinates.

The following examples should illustrate how to use the package.

In[1]:=
<< "Calculus`VectorAnalysis`"

In[2]:=
CoordinateSystem[]

Out[2]=
Cartesian[]

In[3]:=
pt1 = CoordinatesFromCartesian[{1, 0, 0}, Spherical]

Out[3]=
Pi
{1, --, 0}
2

In[4]:=
pt2 = CoordinatesFromCartesian[{0, 1, 0}, Spherical]

Out[4]=
Pi  Pi
{1, --, --}
2   2

In[5]:=
pt3 = CrossProduct[pt1, pt2, Spherical]

Out[5]=
{1, 0, 0}

In[6]:=
CoordinatesToCartesian[pt3, Spherical]

Out[6]=
{0, 0, 1}

In[7]:=
SetCoordinates[Spherical[r, theta, phi]]

Out[7]=
Spherical[r, theta, phi]

In[8]:=
CoordinateRanges[]

Out[8]=
{0 <= r < Infinity, 0 <= theta <= Pi, -Pi < phi <= Pi}

In[9]:=
pt1 = CoordinatesFromCartesian[{1, 0, 0}]

Out[9]=
Pi
{1, --, 0}
2

In[10]:=
pt2 = CoordinatesFromCartesian[{0, 1, 0}]

Out[10]=
Pi  Pi
{1, --, --}
2   2

In[11]:=
pt3 = CrossProduct[pt1, pt2]

Out[11]=
{1, 0, 0}

In[12]:=
CoordinatesToCartesian[pt3]

Out[12]=
{0, 0, 1}

Regards,
Jean-Marc

• Prev by Date: Re: FourierTransform and removable singularities
• Next by Date: Porting waveforms out of Mathematica and into a D/A converter
• Previous by thread: Re: CrossProduct in Spherical Coordinates
• Next by thread: Signals and systems