VecD
3D vector of double precision values.
A direct copy of Vec, except for replacing ‘float’ with ‘double’.
Category: Utility
Base class: _BlipValue
Properties
maxComponent : float (Read-Only)
Maximum component of the vector.
minComponent : float (Read-Only)
Minimum component (x, y, or z) of the vector.
The minimum component of the vector.x : float
The x component of the vector.
UserName: X
y : float
The y component of the vector.
UserName: Y
z : float
The z component of the vector.
UserName: Z
Constructors
__init__(self)
__init__(self, _x: float, _y: float)
__init__(self, _x: float, _y: float, _z: float)
__init__(self, v: Vec2)
__init__(self, v: Vec)
__init__(self, other: VecD)
Copy constructor for VecD
Methods
angles(self) -> VecD
The Euler angles that rotate (0,0,-1) to be parallel with this vector.
Returns The Euler angles as a Vec of (heading, elevation, 0), in normalised coordinates.
cross(self, v: VecD) -> VecD
Computes the cross product of two vectors.
Parameters:
- v: The other vector to compute the cross product with.
Returns The cross product of this vector and the given vector.
dot(self, v: VecD) -> float
Calculates the dot product of two vectors.
Parameters:
- v: The other vector to calculate the dot product with.
Returns The dot product of this vector and the given vector.
length(self) -> float
The length of the vector in 3D space.
normalise(self) -> VecD
Returns a normalized version of the vector.
Returns A normalized version of the vector.
round(self, v: VecD) -> VecD
Rounds the components of a vector to the closest increment in each component of the given vector.
Parameters:
- v: A vector representing the increment to round each component to.
Returns A new vector with the rounded components.
Special Methods
__add__(self, v: VecD) -> VecD
Adds two vectors.
Parameters:
- v: The VecD object to add to this one.
Returns The component-wise sum of this and the input vector.
__div__(self, v: VecD) -> VecD
Divides two vectors component-wise.
Parameters:
- v: The other vector to divide by.
Returns The result of dividing this vector component-wise by the given vector.
__eq__(self, v: VecD) -> bool
Tests for equality between two vectors.
Parameters:
- v: The vector to compare with.
Returns True if all components of the vectors are equal, false otherwise.
__mul__(self, v: VecD) -> VecD
Multiplies two vectors component-wise.
Parameters:
- v: The other vector to multiply with.
Returns The component-wise product of this vector and the given vector.
__ne__(self, v: VecD) -> bool
Tests for inequality between two vectors.
Parameters:
- v: The vector to compare with.
Returns True if any of the components of the vectors are not equal, false otherwise.
__sub__(self, v: VecD) -> VecD
Subtracts another vector from this vector.
Parameters:
- v: The vector to subtract from this vector.
Returns The resulting vector after component-wise subtraction.