Roboid Control for Python
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Direction Class Reference

Detailed Description

A direction using angles.

Public Member Functions

 __init__ (self, horizontal=Angle(), vertical=Angle())
 Create a new direction.
 
 FromVector3 (Vector3 v)
 
Vector3 ToVector3 (self)
 Convert the direction to a Vector3 coordinate.
 
 __eq__ (self, direction)
 Test whether this direction is equal to another direction.
 
 __neg__ (self)
 Negate/reverse the direction.
 
 Inverse (self)
 This is a synonym for negation.
 
 Normalize (self)
 Normalize this vector to the specified ranges.
 
 __repr__ (self)
 
 __init__ (self, horizontal=Angle(), vertical=Angle())
 Create a new direction.
 
 FromVector3 (Vector3 v)
 
Vector3 ToVector3 (self)
 Convert the direction to a Vector3 coordinate.
 
 __eq__ (self, direction)
 Test whether this direction is equal to another direction.
 
 isclose (self, other, rel_tol=1e-9, abs_tol=1e-8)
 
 __neg__ (self)
 Negate/reverse the direction.
 
 Inverse (self)
 This is a synonym for negation.
 
 Normalize (self)
 Normalize this vector to the specified ranges.
 
 __repr__ (self)
 

Static Public Member Functions

 Degrees (float horizontal, float vertical)
 Create a direction using angle values in degrees.
 
 Radians (float horizontal, float vertical)
 Create a direction using angle values in radians.
 
 Degrees (float horizontal, float vertical)
 Create a direction using angle values in degrees.
 
 Radians (float horizontal, float vertical)
 Create a direction using angle values in radians.
 

Public Attributes

 horizontal
 
 vertical
 

Static Public Attributes

 zero
 
 forward
 
 backward
 
 up
 
 down
 
 left
 
 right
 

Constructor & Destructor Documentation

◆ __init__() [1/2]

__init__ (   self,
  horizontal = Angle(),
  vertical = Angle() 
)

Create a new direction.

Parameters
horizontalThe horizontal angle
verticalThe vertical angle.

◆ __init__() [2/2]

__init__ (   self,
  horizontal = Angle(),
  vertical = Angle() 
)

Create a new direction.

Parameters
horizontalThe horizontal angle
verticalThe vertical angle.

Member Function Documentation

◆ Degrees() [1/2]

Degrees ( float  horizontal,
float  vertical 
)
static

Create a direction using angle values in degrees.

Parameters
horizontalThe horizontal angle in degrees
verticalThe vertical angle in degrees
Returns
The direction

◆ Radians() [1/2]

Radians ( float  horizontal,
float  vertical 
)
static

Create a direction using angle values in radians.

Parameters
horizontalThe horizontal angle in radians
verticalThe vertical angle in radians
Returns
The direction

◆ ToVector3() [1/2]

Vector3 ToVector3 (   self)

Convert the direction to a Vector3 coordinate.

Returns
The vector coordinate

◆ __eq__() [1/2]

__eq__ (   self,
  direction 
)

Test whether this direction is equal to another direction.

Parameters
directionThe direction to compare to
Returns
True when the direction angles are equal, false otherwise.

◆ __neg__() [1/2]

__neg__ (   self)

Negate/reverse the direction.

Returns
The reversed direction.

◆ Normalize() [1/2]

Normalize (   self)

Normalize this vector to the specified ranges.

Note
Should not be needed but available in case it is.

◆ Degrees() [2/2]

Degrees ( float  horizontal,
float  vertical 
)
static

Create a direction using angle values in degrees.

Parameters
horizontalThe horizontal angle in degrees
verticalThe vertical angle in degrees
Returns
The direction

◆ Radians() [2/2]

Radians ( float  horizontal,
float  vertical 
)
static

Create a direction using angle values in radians.

Parameters
horizontalThe horizontal angle in radians
verticalThe vertical angle in radians
Returns
The direction

◆ ToVector3() [2/2]

Vector3 ToVector3 (   self)

Convert the direction to a Vector3 coordinate.

Returns
The vector coordinate

◆ __eq__() [2/2]

__eq__ (   self,
  direction 
)

Test whether this direction is equal to another direction.

Parameters
directionThe direction to compare to
Returns
True when the direction angles are equal, false otherwise.

◆ __neg__() [2/2]

__neg__ (   self)

Negate/reverse the direction.

Returns
The reversed direction.

◆ Normalize() [2/2]

Normalize (   self)

Normalize this vector to the specified ranges.

Note
Should not be needed but available in case it is.

The documentation for this class was generated from the following files: