       Re: Re: Re: coordinate transformation

• To: mathgroup at smc.vnet.net
• Subject: [mg13340] Re: [mg13308] Re: [mg13169] Re: [mg13117] coordinate transformation
• From: David Withoff <withoff>
• Date: Mon, 20 Jul 1998 02:49:58 -0400
• Sender: owner-wri-mathgroup at wolfram.com

```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:

In:= << Calculus`VectorAnalysis`

Introduce two random vectors.

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

Out= {0.0544546, 0.199285, 0.612214}

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

Out= {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:= CrossProduct[v1, v2]

Out= {-0.489489, 0.597657, -0.151008}

Now do the same calculation in spherical coordinates.

Convert the vectors to spherical coordinates.

In:= sv1 = CoordinatesFromCartesian[v1, Spherical]

Out= {0.646131, 0.32545, 1.30406}

In:= sv2 = CoordinatesFromCartesian[v2, Spherical]

Out= {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:= sprod = CrossProduct[sv1, sv2, Spherical]

Out= {0.787145, 1.76384, 2.25702}

Convert this result back to cartesian coordinates.

In:= CoordinatesToCartesian[sprod, Spherical]

Out= {-0.489489, 0.597657, -0.151008}

Observe that Out and Out 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