Coordinate Transformations Next: Previous: Special Functions Up: Arithmetic



Coordinate Transformations

[theta r] = cart2pol (x, y) Function File
[theta r, z] = cart2pol (x, y, z) Function File
Transform cartesian to polar or cylindrical coordinates. x y (and z) must be of same shape. theta describes the angle relative to the x - axis. r is the distance to the z - axis (0 0, z).

[x y] = pol2cart (theta, r) Function File
[x y, z] = pol2cart (theta, r, z) Function File
Transform polar or cylindrical to cartesian coordinates. theta r (and z) must be of same shape. theta describes the angle relative to the x - axis. r is the distance to the z - axis (0 0, z).

[theta phi, r] = cart2sph (x, y, z) Function File
Transform cartesian to spherical coordinates. x y and z must be of same shape. theta describes the angle relative to the x - axis. phi is the angle relative to the xy - plane. r is the distance to the origin (0 0, 0).

[x y, z] = sph2cart (theta, phi, r) Function File
Transform spherical to cartesian coordinates. x y and z must be of same shape. theta describes the angle relative to the x-axis. phi is the angle relative to the xy-plane. r is the distance to the origin (0 0, 0).