discretize.utils.rotate_points_from_normals#

discretize.utils.rotate_points_from_normals(xyz, v0, v1, x0=array([0., 0., 0.]))[source]#

Rotate a set of xyz locations about a specified point.

Rotate a grid of Cartesian points about a location x0 according to the rotation defined from vector v0 to v1.

Let x represent an input xyz location, let x0 be the origin of rotation, and let R denote the rotation matrix from vector v0 to v1. Where x is the new xyz location, this function outputs the following operation for all input locations:

x=R(xx0)+x0
Parameters:
xyz(n, 3) numpy.ndarray

locations to rotate

v0(3) numpy.ndarray

Starting orientation direction

v1(3) numpy.ndarray

Finishing orientation direction

x0(3) numpy.ndarray, optional

The origin of rotation.

Returns:
(n, 3) numpy.ndarray

The rotated xyz locations.