Vector2
Overview
Vector2 is a class in Aspose.3D FOSS for Python.
Vector2.set sets the vector’s x and y components to the provided float values.
This class declares 7 methods for Vector2 objects in Python programs.
Available methods include: __eq__, __getitem__, __init__, __repr__, __setitem__, parse, set.
Public members are accessible to any Python application after installing the Aspose.3D FOSS for Python package.
Properties: length, length2, x, y.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
x | float | Read/Write | Gets or sets the x. |
y | float | Read/Write | Gets or sets the y. |
length | float | Read | Gets the length. |
length2 | float | Read | Gets the length2. |
Methods
| Signature | Description |
|---|---|
__init__(x: float, y: float) | Calls init(x, y) on this Vector2 instance. |
set(new_x: float, new_y: float) | Sets the vector’s x and y components to the provided float values |
parse(input: str) | Creates a Vector2 from a string representation such as “x,y” |
__getitem__(key: int) → float | Calls getitem(key) on this Vector2 instance. |
__setitem__(key: int, value: float) | Calls setitem(key, value) on this Vector2 instance. |
__repr__() → str | Calls repr on this Vector2 instance. |
__eq__(other) → bool | Calls eq(other) on this Vector2 instance. |