rotatePoints

pyvsim.Utils.rotatePoints(points, angle, axis, origin)[source]

Wrap-around Euler-Rodrigues formula formula for rotating a point cloud

Parameters :

points : numpy.ndarray \((N,3)\)

A point (size = 3) or a list of points (N rows, 3 columns) to be rotated

angle : scalar

scalar (in radians)

axis : numpy.ndarray \((3)\)

A vector around which the points are rotated

origin : numpy.ndarray \((3)\)

A point around which the points are rotated

Returns :

points : numpy.ndarray \((N,3)\)

A list of rotated points

Examples

>>> o = np.array([0,0,0])
>>> [x,y,z] = np.eye(3)
>>> temp = rotatePoints(x, np.pi/2, z, o)
>>> aeq(temp, y)
True

This works also for lists of vectors:

>>> X = np.tile(x,(100,1))
>>> Y = np.tile(y,(100,1))
>>> Z = np.tile(z,(100,1))
>>> temp = rotatePoints(X, np.pi/2, Z, o)
>>> aeq(temp, Y)

True

This Page