class documentation
A simple 3D vector class.
| Parameters | |
| x | The x-coordinate of the vector. Defaults to 0. |
| y | The y-coordinate of the vector. Defaults to 0. |
| z | The z-coordinate of the vector. Defaults to 0. |
| Class Method | from |
Ensure the value is a Vector, converting from a tuple if needed. |
| Method | __add__ |
Add another vector or tuple to this vector. |
| Method | __eq__ |
Check equality with another vector or tuple. |
| Method | __init__ |
Initialize the vector coordinates. |
| Method | __mul__ |
Scale this vector by a scalar value. |
| Method | __setattr__ |
Route attribute assignment through the underlying setters. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | x |
The x-coordinate of the vector. |
| Instance Variable | y |
The y-coordinate of the vector. |
| Instance Variable | z |
The z-coordinate of the vector. |
Check equality with another vector or tuple.
| Parameters | |
other:tuple or Vector | The value to compare against. |
| Returns | |
bool | True if all components are equal, False otherwise. |
Initialize the vector coordinates.
| Parameters | |
x:int or float | The x-coordinate. Defaults to 0. |
y:int or float | The y-coordinate. Defaults to 0. |
z:int or float | The z-coordinate. Defaults to 0. |
Scale this vector by a scalar value.
| Parameters | |
scalar:int or float | The scalar to multiply each component by. |
| Returns | |
Vector | A new scaled vector. |