Vector3D
#
- class ansys.geometry.core.math.vector.Vector3D(shape, dtype=float, buffer=None, offset=0, strides=None, order=None)#
Bases:
numpy.ndarray
Provides for managing and creating a 3D vector.
- Parameters:
- input
ndarray
|RealSequence
3D
numpy.ndarray
class with shape(X,).
- input
Overview#
Create a 3D vector from two distinct 3D points. |
Check if this vector and another vector are perpendicular. |
|
Check if this vector and another vector are parallel. |
|
Check if this vector and another vector are opposite. |
|
Return a normalized version of the 3D vector. |
|
Transform the 3D vector3D with a transformation matrix. |
|
Get the angle between this 3D vector and another 3D vector. |
|
Get the cross product of |
Import detail#
from ansys.geometry.core.math.vector import Vector3D
Property detail#
- property Vector3D.x: ansys.geometry.core.typing.Real#
X coordinate of the
Vector3D
class.
- property Vector3D.y: ansys.geometry.core.typing.Real#
Y coordinate of the
Vector3D
class.
- property Vector3D.z: ansys.geometry.core.typing.Real#
Z coordinate of the
Vector3D
class.
Method detail#
- Vector3D.is_perpendicular_to(other_vector: Vector3D) bool #
Check if this vector and another vector are perpendicular.
- Vector3D.is_parallel_to(other_vector: Vector3D) bool #
Check if this vector and another vector are parallel.
- Vector3D.is_opposite(other_vector: Vector3D) bool #
Check if this vector and another vector are opposite.
- Vector3D.transform(matrix: ansys.geometry.core.math.matrix.Matrix44) Vector3D #
Transform the 3D vector3D with a transformation matrix.
- Parameters:
- matrix
Matrix44
4x4 transformation matrix to apply to the vector.
- matrix
- Returns:
Vector3D
A new 3D vector that is the transformed copy of the original 3D vector after applying the transformation matrix.
Notes
Transform the
Vector3D
object by applying the specified 4x4 transformation matrix and return a newVector3D
object representing the transformed vector.
- Vector3D.get_angle_between(v: Vector3D) pint.Quantity #
Get the angle between this 3D vector and another 3D vector.
- Parameters:
- v
Vector3D
Other 3D vector for computing the angle.
- v
- Returns:
Quantity
Angle between these two 3D vectors.
- Vector3D.__mul__(other: Vector3D | ansys.geometry.core.typing.Real) Vector3D | ansys.geometry.core.typing.Real #
Overload * operator with dot product.
Notes
This method also admits scalar multiplication.
- Vector3D.__add__(other: Vector3D | ansys.geometry.core.math.point.Point3D) Vector3D | ansys.geometry.core.math.point.Point3D #
Addition operation overload for 3D vectors.
- classmethod Vector3D.from_points(point_a: numpy.ndarray | ansys.geometry.core.typing.RealSequence | ansys.geometry.core.math.point.Point3D, point_b: numpy.ndarray | ansys.geometry.core.typing.RealSequence | ansys.geometry.core.math.point.Point3D)#
Create a 3D vector from two distinct 3D points.
- Parameters:
- Returns:
Vector3D
3D vector from
point_a
topoint_b
.
Notes
The resulting 3D vector is always expressed in
Point3D
base units.