Question: Calculating dot products using spherical coordinates

I would like to be able to calculate 3D vector dot products using the spherical coordinate system, but so far I have not been sucessful.  A few suggestions would be greatly appreciated!

These are my failed attempts:
 

Calculating dot products using spherical coordinatesNULL

With Physics Vectors

 

with(Physics[Vectors])

Setup(mathematicalnotation = true)``

Setup(coordinatesystems = spherical)

[coordinatesystems = {X}]

(1.1)

k_ := _phi*c+_r*a+_theta*b

_phi*c+_r*a+_theta*b

(1.2)

k_.k_

a^2+b^2+c^2

(1.3)

I was hoping for the dot product to be calculated using the spherical coordinate system, but this is the cartesian dot product.

NULL

With Vector Calulus

 

restart

with(VectorCalculus)``

SetCoordinates('spherical'[r, phi, theta])

spherical[r, phi, theta]

(2.1)

``

k := VectorField([a, b, c], coords = spherical[r, phi, theta])

Vector(3, {(1) = a, (2) = b, (3) = c})

(2.2)

k.k

a^2+b^2+c^2

(2.3)

This is also the cartesian dot product.

NULL


 

Download Calculating_dot_products_using_spherical_coordinates.mw

Please Wait...