![]() |
Roboid Control for Python
|
A spherical 3D vector.
Public Member Functions | |
| __init__ (self, float distance, Direction direction) | |
| Create a new spherical vector. | |
| Degrees (float distance, float horizontal, float vertical) | |
| Create sperical vector without using the Direction type. | |
| Radians (float distance, float horizontal, float vertical) | |
| Create sperical vector without using the Direction type. | |
| Vector3 | ToVector3 (self) |
| Convert the spherical coordinate to a Vector3 coordinate. | |
| bool | __eq__ (self, other) |
| Check if this vector is equal to the given vector. | |
| float | Normalized (self) |
| __neg__ (self) | |
| Negate the vector. | |
| __sub__ (self, other) | |
| Subtract a spherical vector from this vector. | |
| __add__ (self, other) | |
| Add a spherical vector to this vector. | |
| __mul__ (self, factor) | |
| Scale the vector uniformly up. | |
| __truediv__ (self, factor) | |
| Scale the vector uniformly down. | |
| Angle | SignedAngle (s1, s2, axis) |
| Calculate the signed angle between two spherical vectors. | |
| __repr__ (self) | |
| __init__ (self, float distance, Direction direction) | |
| Create a new spherical vector. | |
| Degrees (float distance, float horizontal, float vertical) | |
| Create sperical vector without using the Direction type. | |
| Radians (float distance, float horizontal, float vertical) | |
| Create sperical vector without using the Direction type. | |
| Vector3 | ToVector3 (self) |
| Convert the spherical coordinate to a Vector3 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 | Normalized (self) |
| __neg__ (self) | |
| Negate the vector. | |
| __sub__ (self, other) | |
| Subtract a spherical vector from this vector. | |
| __add__ (self, other) | |
| Add a spherical vector to this vector. | |
| __mul__ (self, factor) | |
| Scale the vector uniformly up. | |
| __truediv__ (self, factor) | |
| Scale the vector uniformly down. | |
| Angle | SignedAngle (s1, s2, axis) |
| Calculate the signed angle between two spherical vectors. | |
| __repr__ (self) | |
Static Public Member Functions | |
| FromVector3 (Vector3 v) | |
| Create a Spherical coordinate from a Vector3 coordinate. | |
| float | Distance (v1, v2) |
| Calculate the distance between two spherical coordinates. | |
| Angle | Angle (s1, s2) |
| Calculate the unsigned angle between two spherical vectors. | |
| Rotate (s, Angle horizontal, Angle vertical) | |
| Rotate a spherical vector. | |
| FromVector3 (Vector3 v) | |
| Create a Spherical coordinate from a Vector3 coordinate. | |
| float | Distance (v1, v2) |
| Calculate the distance between two spherical coordinates. | |
| Angle | Angle (s1, s2) |
| Calculate the unsigned angle between two spherical vectors. | |
| Rotate (s, Angle horizontal, Angle vertical) | |
| Rotate a spherical vector. | |
Public Attributes | |
| distance | |
| The direction of the vector. | |
| direction | |
Static Public Attributes | |
| zero | |
| __init__ | ( | self, | |
| float | distance, | ||
| Direction | direction | ||
| ) |
Create a new spherical vector.
| distance | The length of the vector |
| direction | The direction of the vector |
Reimplemented from Polar.
| __init__ | ( | self, | |
| float | distance, | ||
| Direction | direction | ||
| ) |
Create a new spherical vector.
| distance | The length of the vector |
| direction | The direction of the vector |
Reimplemented from Polar.
| Degrees | ( | float | distance, |
| float | horizontal, | ||
| float | vertical | ||
| ) |
Create sperical vector without using the Direction type.
All given angles are in degrees
| distance | The distance in meters |
| horizontal | The horizontal angle in degrees |
| vertical | The vertical angle in degrees |
Reimplemented from Polar.
| Radians | ( | float | distance, |
| float | horizontal, | ||
| float | vertical | ||
| ) |
Create sperical vector without using the Direction type.
All given angles are in radians
| distance | The distance in meters |
| horizontal | The horizontal angle in radians |
| vertical | The vertical angle in radians |
Reimplemented from Polar.
|
static |
Create a Spherical coordinate from a Vector3 coordinate.
| v | The vector coordinate |
| Vector3 ToVector3 | ( | self | ) |
Convert the spherical coordinate to a Vector3 coordinate.
| bool __eq__ | ( | self, | |
| other | |||
| ) |
Check if this vector is equal to the given vector.
| v | The vector to check against |
Reimplemented from Polar.
| float Normalized | ( | self | ) |
Reimplemented from Polar.
| __neg__ | ( | self | ) |
Negate the vector.
Reimplemented from Polar.
| __sub__ | ( | self, | |
| other | |||
| ) |
Subtract a spherical vector from this vector.
| other | The vector to subtract |
Reimplemented from Polar.
| __add__ | ( | self, | |
| other | |||
| ) |
Add a spherical vector to this vector.
| other | The vector to add |
Reimplemented from Polar.
| __mul__ | ( | self, | |
| factor | |||
| ) |
Scale the vector uniformly up.
| factor | The scaling factor |
Reimplemented from Polar.
| __truediv__ | ( | self, | |
| factor | |||
| ) |
Scale the vector uniformly down.
| factor | The scaling factor |
Reimplemented from Polar.
|
static |
Calculate the distance between two spherical coordinates.
| s1 | The first coordinate |
| s2 | The second coordinate |
Reimplemented from Polar.
|
static |
Calculate the unsigned angle between two spherical vectors.
| s1 | The first vector |
| s2 | The second vector |
Reimplemented from Polar.
| Angle SignedAngle | ( | s1, | |
| s2, | |||
| axis | |||
| ) |
Calculate the signed angle between two spherical vectors.
| s1 | The first vector |
| s2 | The second vector |
| axis | The axis around which the angle is calculated |
Reimplemented from Polar.
Rotate a spherical vector.
| s | The vector to rotate |
| horizontal | The horizontal rotation angle in local space |
| vertical | The vertical rotation angle in local space |
| Degrees | ( | float | distance, |
| float | horizontal, | ||
| float | vertical | ||
| ) |
Create sperical vector without using the Direction type.
All given angles are in degrees
| distance | The distance in meters |
| horizontal | The horizontal angle in degrees |
| vertical | The vertical angle in degrees |
Reimplemented from Polar.
| Radians | ( | float | distance, |
| float | horizontal, | ||
| float | vertical | ||
| ) |
Create sperical vector without using the Direction type.
All given angles are in radians
| distance | The distance in meters |
| horizontal | The horizontal angle in radians |
| vertical | The vertical angle in radians |
Reimplemented from Polar.
|
static |
Create a Spherical coordinate from a Vector3 coordinate.
| v | The vector coordinate |
| Vector3 ToVector3 | ( | self | ) |
Convert the spherical coordinate to a Vector3 coordinate.
| bool __eq__ | ( | self, | |
| other | |||
| ) |
Check if this vector is equal to the given vector.
| v | The vector to check against |
Reimplemented from Polar.
| isclose | ( | self, | |
| other, | |||
rel_tol = 1e-9, |
|||
abs_tol = 1e-8 |
|||
| ) |
Reimplemented from Polar.
| float Normalized | ( | self | ) |
Reimplemented from Polar.
| __neg__ | ( | self | ) |
Negate the vector.
Reimplemented from Polar.
| __sub__ | ( | self, | |
| other | |||
| ) |
Subtract a spherical vector from this vector.
| other | The vector to subtract |
Reimplemented from Polar.
| __add__ | ( | self, | |
| other | |||
| ) |
Add a spherical vector to this vector.
| other | The vector to add |
Reimplemented from Polar.
| __mul__ | ( | self, | |
| factor | |||
| ) |
Scale the vector uniformly up.
| factor | The scaling factor |
Reimplemented from Polar.
| __truediv__ | ( | self, | |
| factor | |||
| ) |
Scale the vector uniformly down.
| factor | The scaling factor |
Reimplemented from Polar.
|
static |
Calculate the distance between two spherical coordinates.
| s1 | The first coordinate |
| s2 | The second coordinate |
Reimplemented from Polar.
|
static |
Calculate the unsigned angle between two spherical vectors.
| s1 | The first vector |
| s2 | The second vector |
Reimplemented from Polar.
| Angle SignedAngle | ( | s1, | |
| s2, | |||
| axis | |||
| ) |
Calculate the signed angle between two spherical vectors.
| s1 | The first vector |
| s2 | The second vector |
| axis | The axis around which the angle is calculated |
Reimplemented from Polar.
Rotate a spherical vector.
| s | The vector to rotate |
| horizontal | The horizontal rotation angle in local space |
| vertical | The vertical rotation angle in local space |
| distance |
The direction of the vector.
Normalizing such that distance >= 0