Represents a direction in 2D space.
More...
#include <CDirection2d.h>
Represents a direction in 2D space.
Definition at line 15 of file CDirection2d.h.
◆ CDirection2d() [1/4]
| i2d::CDirection2d::CDirection2d |
( |
| ) |
|
◆ CDirection2d() [2/4]
| i2d::CDirection2d::CDirection2d |
( |
const CDirection2d & |
direction | ) |
|
Construct a new object by copy.
◆ CDirection2d() [3/4]
| i2d::CDirection2d::CDirection2d |
( |
double |
radian | ) |
|
|
explicit |
Construct a new object from radian coordinates.
- Parameters
-
◆ CDirection2d() [4/4]
| i2d::CDirection2d::CDirection2d |
( |
const CVector2d & |
direction | ) |
|
Construct direction using angle of vector.
◆ Avg() [1/2]
Get minimal distance between two directions.
- Returns
- Direction that minimizes the distance to this and dir2.
◆ Avg() [2/2]
Get weighted minimal distance between two directions.
- Returns
- Direction that minimizes the weighted distances between both directions.
◆ DistInDegree()
| double i2d::CDirection2d::DistInDegree |
( |
const CDirection2d & |
dir2 | ) |
const |
Get angle difference in degrees.
- Returns
- Minimal angle distance between the this and dir2 directions in degree [0, +180].
◆ DistInRadian()
| double i2d::CDirection2d::DistInRadian |
( |
const CDirection2d & |
dir2 | ) |
const |
Get angle difference in radians.
- Returns
- Minimal angle distance between the this and dir2 directions in radians [0, +PI].
◆ FromDegree()
| static CDirection2d i2d::CDirection2d::FromDegree |
( |
double |
degree | ) |
|
|
static |
Construct a new CDirection2d object and initialize from degree.
◆ FromRadian()
| static CDirection2d i2d::CDirection2d::FromRadian |
( |
double |
radian | ) |
|
|
static |
Construct a new CDirection2d object and initialize from radian.
◆ IsInRange()
| bool i2d::CDirection2d::IsInRange |
( |
const CDirection2d & |
leftDirectionLimit, |
|
|
const CDirection2d & |
rightDirectionLimit |
|
) |
| const |
Check if the direction is in the direction range between leftDirectionLimit and rightDirectionLimit.
◆ operator==()
| bool i2d::CDirection2d::operator== |
( |
const CDirection2d & |
dir2 | ) |
const |
Compare the objects direction with the one of dir2.
- Parameters
-
| dir2 | direction to compare. |
- Returns
- true if both are equal.
◆ ToDegree()
| double i2d::CDirection2d::ToDegree |
( |
| ) |
const |
Get direction in degrees.
- Returns
- Normalized direction in range [0, 360).
◆ ToRadian()
| double i2d::CDirection2d::ToRadian |
( |
| ) |
const |
Get direction in radians.
- Returns
- Normalized direction in range [-PI, +PI].
◆ TurnByRadian()
| CDirection2d i2d::CDirection2d::TurnByRadian |
( |
double |
turn | ) |
const |
The documentation for this class was generated from the following file: