bfieldtools.sphtools.Rotmatrix

bfieldtools.sphtools.Rotmatrix(sp)

Constructs rotation matrix from cartesian coordinates to spherical.

Parameters
sp: Nx3 array

spherical coordinates [r, theta, phi]

Returns
vmat: 3x3 array

rotation matrix from cartesian to spherical.