rotate¶
Functions for rotations on the unit sphere.
- skysegmentor.rotate3d_Euler(x, y, z, angles, axes='zyz', center=[0.0, 0.0, 0.0])[source]¶
Rotates points in 3D cartesian coordinates by Euler angle around specified axes.
- Parameters:
x (float or array) – Cartesian coordinates.
y (float or array) – Cartesian coordinates.
z (float or array) – Cartesian coordinates.
angles (array) – Euler angles.
axes (str, optional) – Euler angle axes, default z-y-z rotations.
center (list[float], optional) – Center of rotation, default=[0., 0., 0.].
k (array, optional) – If k is specified, points are rotated around a unit vector k.
- Returns:
xrot, yrot, zrot – Rotated x, y and z coordinates.
- Return type:
float or array
- skysegmentor.rotate_usphere(phi, the, angles)[source]¶
Rotates spherical coordinates by Euler angles performed along the z-axis, then y-axis and then z-axis.
- skysegmentor.midpoint_usphere(phi1, phi2, the1, the2)[source]¶
Finds the spherical angular coordinates of the midpoint between two points on a unit sphere.
- Parameters:
- Returns:
midphi, midthe – Midpoint along the longitude phi and latitude theta.
- Return type:
- skysegmentor.rotate2plane(c1, c2)[source]¶
Finds the rotation angles to place the two coordinates c1 and c2 along a latitude = pi/2 (i.e. equator of sphere) and with a midpoint of longitude = pi.
- skysegmentor.forward_rotate(phi, the, a1, a2, a3)[source]¶
Applies a forward rotation of spherical angular coordinates phi and theta using the forward Euler angles of rotation a1, a2 and a3.