MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Re: coordinate transformation


In remarks about Calculus`VectorAnalysis` Sean Ross wrote:

> This whole issue becomes painfully clear with the following exercise:
> Take two cartesian vectors and their cross product.  Transform the
> vectors into cylindrical or spherical coordinates using the transforms
> like those in the mathematica package and take their cross product in
> cylindrical/spherical coordinates and transform the result back to
> cartesian and compare the two.  My hat off to anyone who gets the
> correct answer the first two or three times trying.

Here is (what appears to me to be) a straightforward way to do this:

Load the Calculus`VectorAnalysis` package:

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

Introduce two random vectors.

In[2]:= v1 = {Random[], Random[], Random[]}

Out[2]= {0.0544546, 0.199285, 0.612214}

In[3]:= v2 = {Random[], Random[], Random[]}

Out[3]= {0.985127, 0.832121, 0.100095}

Compute the cross product.  By default, the vectors are assumed to be
given in cartesian coordinates, and the result is in cartesian
coordinates.

In[4]:= CrossProduct[v1, v2]

Out[4]= {-0.489489, 0.597657, -0.151008}

Now do the same calculation in spherical coordinates.

Convert the vectors to spherical coordinates.

In[5]:= sv1 = CoordinatesFromCartesian[v1, Spherical]

Out[5]= {0.646131, 0.32545, 1.30406}

In[6]:= sv2 = CoordinatesFromCartesian[v2, Spherical]

Out[6]= {1.29341, 1.49333, 0.7014}

Compute the cross product, treating the vectors as given in spherical
coordinates, and giving the result in spherical coordinates.

In[7]:= sprod = CrossProduct[sv1, sv2, Spherical]

Out[7]= {0.787145, 1.76384, 2.25702}

Convert this result back to cartesian coordinates.

In[8]:= CoordinatesToCartesian[sprod, Spherical]

Out[8]= {-0.489489, 0.597657, -0.151008}

Observe that Out[4] and Out[8] are the same.

Is this the example that you had in mind?  If so, do you have any
suggestions for how this should be done instead?  If not, could you
offer some clarifications of your concerns?

You have publicized various warnings about disagreements between
Mathematica and "physical mathematics", but you haven't offered any
specific examples to illustrate what Mathematica should have done
instead.  In the absence of any specific alternate design, it is
difficult to tell if it is possible to change Mathematica so that you
would be happy with it, or if your complaints are reflections of some
other problem.  Exactly how do you think these functions should be
changed?  Specific examples are desperately needed.

Dave Withoff
Wolfram Research


  • Prev by Date: Re: Re: Derivatives D[ ] as Functions: Summary (LONGISH)
  • Next by Date: The "Users" directory under NT
  • Previous by thread: Re: Re: Re: coordinate transformation
  • Next by thread: Re: Re: Re: coordinate transformation