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

NameTypeAccessDescription
xfloatRead/WriteGets or sets the x.
yfloatRead/WriteGets or sets the y.
zfloatRead/WriteGets or sets the z.
lengthfloatReadGets the length.
length2floatReadGets the length2.
zero'Vector3'ReadGets the zero.
one'Vector3'ReadGets the one.
unit_x'Vector3'ReadGets the unit x.
unit_y'Vector3'ReadGets the unit y.
unit_z'Vector3'ReadGets the unit z.

Methods

SignatureDescription
__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')floatReturns 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)floatReturns 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')intCompares this vector to another lexicographically and returns an int
parse(input: str)'Vector3'Creates a Vector3 from a string representation

See Also

 English