py3dframe.Frame.axes#
- property Frame.axes: ndarray#
The basis vectors of the frame relative to the parent frame.
The axes is a 3x3 matrix with shape (3, 3) representing the basis vectors of the frame in the parent frame coordinates. The first column is the x-axis, the second column is the y-axis and the third column is the z-axis.
Note
This property is settable.
See also
attribute
parentto get or set the parent frame.attribute
x_axisto access the x-axis of the frame.attribute
y_axisto access the y-axis of the frame.attribute
z_axisto access the z-axis of the frame.attribute
global_axesto access the basis vectors of the frame in the global frame coordinates.
- Parameters:
axes (numpy.ndarray) – The basis vectors of the frame in the parent frame coordinates as an array-like with shape (3, 3).
- Returns:
The basis vectors of the frame in the parent frame coordinates with shape (3, 3).
- Return type:
Examples
Lets define the axes of a frame.
import numpy from py3dframe import Frame
frame = Frame.canonical()
# Define the axes of the frame (Axes will be normalized) x_axis = numpy.array([1, 0, 0]) y_axis = numpy.array([0, 2, 0]) z_axis = numpy.array([0, 0, 3])
axes = numpy.column_stack((x_axis, y_axis, z_axis)) frame.axes = axes print(“Axes of the frame:”, frame.axes) # Output: Axes of the frame: [[1. 0. 0.] # [0. 1. 0.] # [0. 0. 1.]]