![]() |
Roboid Control for Python
|
A polar 2D vector.
Public Member Functions | |
| __init__ (self, float distance, Angle angle) | |
| Create a new polar vector. | |
| Degrees (float distance, float degrees) | |
| Create a polar vector without using the Angle type. | |
| Radians (float distance, float radians) | |
| Create polar vector without using the Angle type. | |
| Vector2 | ToVector2 (self) |
| Convert the polar coordinate to a Vector2 coordinate. | |
| bool | __eq__ (self, other) |
| Check if this vector is equal to the given vector. | |
| float | Magnitude (self) |
| Normalized (self) | |
| __neg__ (self) | |
| Negate the vector. | |
| __sub__ (self, other) | |
| Subtract a polar vector from this vector. | |
| __add__ (self, other) | |
| Add a polar vector to this vector. | |
| __mul__ (self, factor) | |
| Scale the vector uniformly up. | |
| __truediv__ (self, factor) | |
| Scale the vector uniformly down. | |
| Lerp (v1, v2, float f) | |
| Lerp (linear interpolation) between two vectors. | |
| __init__ (self, float distance, Angle angle) | |
| Create a new polar vector. | |
| Degrees (float distance, float degrees) | |
| Create a polar vector without using the Angle type. | |
| Radians (float distance, float radians) | |
| Create polar vector without using the Angle type. | |
| Vector2 | ToVector2 (self) |
| Convert the polar coordinate to a Vector2 coordinate. | |
| bool | __eq__ (self, other) |
| Check if this vector is equal to the given vector. | |
| isclose (self, other, rel_tol=1e-9, abs_tol=1e-8) | |
| float | Magnitude (self) |
| Normalized (self) | |
| __neg__ (self) | |
| Negate the vector. | |
| __sub__ (self, other) | |
| Subtract a polar vector from this vector. | |
| __add__ (self, other) | |
| Add a polar vector to this vector. | |
| __mul__ (self, factor) | |
| Scale the vector uniformly up. | |
| __truediv__ (self, factor) | |
| Scale the vector uniformly down. | |
| Lerp (v1, v2, float f) | |
| Lerp (linear interpolation) between two vectors. | |
Static Public Member Functions | |
| FromVector2 (Vector2 v) | |
| Create a polar coordinate from a Vector2 coordinate. | |
| float | Distance (v1, v2) |
| Calculate the distance between two spherical coordinates. | |
| Angle | Angle (v1, v2) |
| Calculate the unsigned angle between two spherical vectors. | |
| Angle | SignedAngle (v1, v2) |
| Calculate the unsigned angle between two spherical vectors. | |
| FromVector2 (Vector2 v) | |
| Create a polar coordinate from a Vector2 coordinate. | |
| float | Distance (v1, v2) |
| Calculate the distance between two spherical coordinates. | |
| Angle | Angle (v1, v2) |
| Calculate the unsigned angle between two spherical vectors. | |
| Angle | SignedAngle (v1, v2) |
| Calculate the unsigned angle between two spherical vectors. | |
Public Attributes | |
| distance | |
| The direction of the vector. | |
| direction | |
Static Public Attributes | |
| zero | |
| __init__ | ( | self, | |
| float | distance, | ||
| Angle | angle | ||
| ) |
| __init__ | ( | self, | |
| float | distance, | ||
| Angle | angle | ||
| ) |
| Degrees | ( | float | distance, |
| float | degrees | ||
| ) |
| Radians | ( | float | distance, |
| float | radians | ||
| ) |
|
static |
Create a polar coordinate from a Vector2 coordinate.
| v | The vector coordinate |
| Vector2 ToVector2 | ( | self | ) |
Convert the polar coordinate to a Vector2 coordinate.
| bool __eq__ | ( | self, | |
| other | |||
| ) |
Check if this vector is equal to the given vector.
| v | The vector to check against |
| __neg__ | ( | self | ) |
| __sub__ | ( | self, | |
| other | |||
| ) |
| __add__ | ( | self, | |
| other | |||
| ) |
| __mul__ | ( | self, | |
| factor | |||
| ) |
| __truediv__ | ( | self, | |
| factor | |||
| ) |
|
static |
|
static |
Calculate the unsigned angle between two spherical vectors.
| v1 | The first vector |
| v2 | The second vector |
|
static |
Calculate the unsigned angle between two spherical vectors.
| v1 | The first vector |
| v2 | The second vector |
| Lerp | ( | v1, | |
| v2, | |||
| float | f | ||
| ) |
Lerp (linear interpolation) between two vectors.
| v1 | The starting vector |
| v2 | The ending vector |
| f | The interpolation distance |
| Degrees | ( | float | distance, |
| float | degrees | ||
| ) |
| Radians | ( | float | distance, |
| float | radians | ||
| ) |
|
static |
Create a polar coordinate from a Vector2 coordinate.
| v | The vector coordinate |
| Vector2 ToVector2 | ( | self | ) |
Convert the polar coordinate to a Vector2 coordinate.
| bool __eq__ | ( | self, | |
| other | |||
| ) |
Check if this vector is equal to the given vector.
| v | The vector to check against |
| __neg__ | ( | self | ) |
| __sub__ | ( | self, | |
| other | |||
| ) |
| __add__ | ( | self, | |
| other | |||
| ) |
| __mul__ | ( | self, | |
| factor | |||
| ) |
| __truediv__ | ( | self, | |
| factor | |||
| ) |
|
static |
|
static |
Calculate the unsigned angle between two spherical vectors.
| v1 | The first vector |
| v2 | The second vector |
|
static |
Calculate the unsigned angle between two spherical vectors.
| v1 | The first vector |
| v2 | The second vector |
| Lerp | ( | v1, | |
| v2, | |||
| float | f | ||
| ) |
Lerp (linear interpolation) between two vectors.
| v1 | The starting vector |
| v2 | The ending vector |
| f | The interpolation distance |
| distance |
The direction of the vector.
Normalizing such that distance >= 0