Vector3
Overview
Vector3 is a class in Aspose.3D FOSS for Python.
Vector3 offers dot product, cross product, normalization, angle calculation, and component‑wise trigonometric functions.
This class declares 10 methods for Vector3 objects in Python programs.
Available methods include: __init__, angle_between, compare_to, cos, cross, dot, normalize, parse, set, sin.
All public members are accessible to any Python application after installing the Aspose.3D FOSS for Python package.
Properties: length, length2, one, unit_x, unit_y, unit_z, and 4 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
x | float | Read/Write | Gets or sets the x. |
y | float | Read/Write | Gets or sets the y. |
z | float | Read/Write | Gets or sets the z. |
length | float | Read | Gets the length. |
length2 | float | Read | Gets the length2. |
zero | 'Vector3' | Read | Gets the zero. |
one | 'Vector3' | Read | Gets the one. |
unit_x | 'Vector3' | Read | Gets the unit x. |
unit_y | 'Vector3' | Read | Gets the unit y. |
unit_z | 'Vector3' | Read | Gets the unit z. |
Methods
| Signature | Description |
|---|---|
__init__(x, y, z) | Calls init(x, y, z) on this Vector3 instance. |
set(new_x: float, new_y: float, new_z: float) | Calls set(new_x, new_y, new_z) on this Vector3 instance. |
dot(rhs: 'Vector3') → float | Returns the dot product of this vector with another Vector3 |
cross(rhs: 'Vector3') → 'Vector3' | Returns a new Vector3 that is the cross product with another vector |
normalize() → 'Vector3' | ` returns a unit vector that points in the same direction as the original vector |
angle_between(dir: 'Vector3', up) → float | Returns the angle in radians between this vector and another, using up direction |
sin() → 'Vector3' | Returns a Vector3 whose components are the sine of each component of this vector |
cos() → 'Vector3' | Calls cos on this Vector3 instance. |
compare_to(other: 'Vector3') → int | Compares this vector to another lexicographically and returns an int |
parse(input: str) → 'Vector3' | Creates a Vector3 from a string representation |