ReferenceFrame API Reference#
Table of Contents
The ReferenceFrame object allows the user to represent reference frames without needing to keep track and correctly handle a rotation matrix and offset vectors. The ReferenceFrame class holds this information and handles rotating to and from the reference frame for you.
- class pyevspace.ReferenceFrame(order, angles[, *, offset])#
A class that holds all information for a reference frame, and methods to handling rotating between it and other frames.
Attributes#
- ReferenceFrame.order#
Read-only attribute of the Order object used to instantiate the ReferenceFrame.
- Type:
- ReferenceFrame.matrix#
Read-only attribute of the internal matrix used to compute vector rotations.
- Type:
- ReferenceFrame.angles#
The
Angles
object used to instantate theRefernceFrame
. Setting this value or any of its angle attributes will cause the internal matrix to be recomputed.>>> ref = ReferenceFrame(XYZ, Angles(1, 2, 3)) >>> ref.matrix Matrix([0.411982, 0.0587266, 0.909297] [-0.681243, -0.642873, 0.350175] [0.605127, -0.763718, -0.224845]) >>> ref.angles.alpha = 2 >>> # ref.matrix updated >>> ref.matrix Matrix([0.411982, 0.0587266, 0.909297] [-0.877274, 0.295301, 0.378401] [-0.246294, -0.953598, 0.173178])
- Type:
Instance Methods#
- ReferenceFrame.rotateTo(vector)#
Rotates vector to this reference frame.
- ReferenceFrame.rotateFrom(vector)#
Rotates vector from this reference frame.
- ReferenceFrame.rotateToFrame(frame, vector)#
Rotates vector from this reference frame to another reference frame.
- Parameters:
frame (ReferenceFrame) – reference frame to rotate vector to
vector (Vector) – vector to be rotated
- Returns:
the rotated vector
- Return type:
- ReferenceFrame.rotateFromFrame(frame, vector)#
Rotates vector to this reference frame from another reference frame.
- Parameters:
frame (ReferenceFrame) – reference frame to rotate vector from
vector (Vector) – vector to be rotated
- Returns:
the rotated vector
- Return type: