Vector Analysis

Spherical to rectangular coordinates

x = r sinq cosf
y = r sinq sinq
z = r cosq

Rectangular to spherical coordinates

r = sqrt(x2+ y2 + z2)
q = cos -1(z/r)
f = tan -1(y/x) = sin -1(y/rsinq) = cos -1(x/rsinq)

If,
A = ax i + ay j + az k
B = bx i + by j + bz k ,
where i, j, and k are unit vectors in the x, y, and z directions.
|A| = sqrt(ax2 + ay2 + az2)
|B| = sqrt(bx2 + by2 + bz2)
then:

Dot (scaler) procuct

A.B = |A||B|cos a, where a is angle between the vectors.
A.B = axbx + ayby + azbz

Cross Product

AXB = |A||B|sin a v, where v is a unit vector perpendicular to A and B
AXB = (aybz - azby) i + (azbx - axbz) j + (axby - aybx) k