#include <BALL/MATHS/angle.h>
List of all members.
Detailed Description
template<typename T>
class BALL::TAngle< T >
Generic Angle Class. Use this class to describe angles. The TAngle class permits the conversion from degree to radians and is the return type of all functions used to calculate angles.
Definition at line 54 of file angle.h.
Member Enumeration Documentation
form of the angle range: RANGE__UNLIMITED = 0
no limitations RANGE__UNSIGNED = 1
0 <= angle <= 360, 0 <= angle <= PI * 2 RANGE__SIGNED = 2
-180 <= angle <= 180, -PI <= angle <= PI
- Enumerator:
RANGE__UNLIMITED |
|
RANGE__UNSIGNED |
|
RANGE__SIGNED |
|
Definition at line 69 of file angle.h.
Constructor & Destructor Documentation
Default constructor. Creates a new angle object. Its value is set to 0.
Definition at line 386 of file angle.h.
Copy constructor. Create a copy of a TAngle object. Copies are always shallow.
- Parameters:
-
| angle | the object to be copied |
Definition at line 392 of file angle.h.
Detailed constructor. Create a new angle object and set its value to new_value
. radian
determines whether new_value
is in radians or in degrees.
- Parameters:
-
| new_value | the value of the angle object |
| radian | true if new_value is in radians, false otherwise |
Definition at line 398 of file angle.h.
Destructor.
Definition at line 106 of file angle.h.
Member Function Documentation
Clear method The value is set to 0.
Definition at line 113 of file angle.h.
template<typename T >
void BALL::TAngle< T >::dump |
( |
std::ostream & |
s = std::cout , |
|
|
Size |
depth = 0 | |
|
) |
| | const [inline] |
Internal state dump. Dump the current internal state of {*this} to the output ostream s with dumping depth depth .
- Parameters:
-
| s | - output stream where to output the internal state of {*this} |
| depth | - the dumping depth |
Definition at line 694 of file angle.h.
Assign the value to a variable of type T
.
- Parameters:
-
| val | the variable to assign the value to |
| radian | if set to true assigns the value in radians (default). |
Definition at line 448 of file angle.h.
Assign the value to another angle.
- Parameters:
-
| angle | the angle to assign the value to |
Definition at line 442 of file angle.h.
Test whether two angles are equivalent. Both angles are normalized and afterwards compared with Maths::isEqual instead of comparing the values directly.
- Parameters:
-
| angle | the angle to compare with |
- Returns:
- bool, true if {*this} angle is equal to
value
Definition at line 677 of file angle.h.
Test whether instance is valid. Always returns true
- Returns:
- bool true
Definition at line 688 of file angle.h.
Negate the angle
Definition at line 523 of file angle.h.
Normalize the angle over a given range. RANGE__UNLIMITED = 0
no limitations. RANGE__UNSIGNED = 1
. RANGE__SIGNED = 2
.
- Parameters:
-
| range | the range of the angle |
Definition at line 488 of file angle.h.
Cast operator
- Returns:
- value in radians
Definition at line 456 of file angle.h.
Inequality operator This test uses Maths::isNotEqual instead of comparing the values directly.
- Parameters:
-
| angle | the angle to compare with |
- Returns:
- bool, true if the two angles are not equal
Definition at line 640 of file angle.h.
Multiply a value with this angle.
- Parameters:
-
| val | the value to multiply by |
- Returns:
- TAngle, {*this}
Definition at line 588 of file angle.h.
Multiply an angle with this angle.
- Parameters:
-
| angle | the angle to multiply by |
- Returns:
- TAngle, {*this}
Definition at line 581 of file angle.h.
Positive sign.
Definition at line 529 of file angle.h.
Add a value to this angle.
- Parameters:
-
- Returns:
- TAngle, {*this}
Definition at line 548 of file angle.h.
Subtraction an angle from this angle.
- Parameters:
-
| angle | the angle to substract |
- Returns:
- TAngle, the new angle
Definition at line 575 of file angle.h.
Negative sign.
Definition at line 535 of file angle.h.
Substract a value from this angle.
- Parameters:
-
| val | the value to substract |
- Returns:
- TAngle, {*this}
Definition at line 568 of file angle.h.
Substraction operator.
- Parameters:
-
| angle | the angle to substract |
- Returns:
- TAngle, {*this}
Definition at line 561 of file angle.h.
Divide this angle by a value.
- Parameters:
-
| val | the angle to divide by |
- Returns:
- TAngle, the new angle
Definition at line 622 of file angle.h.
Divide this angle by a value.
- Parameters:
-
| val | the angle to divide by |
- Returns:
- TAngle, {*this}
Definition at line 608 of file angle.h.
Division operator.
- Parameters:
-
| angle | the angle to divide by |
- Returns:
- TAngle, {*this}
Definition at line 595 of file angle.h.
Is less operator. This test uses Maths::isLess instead of comparing the values directly.
- Parameters:
-
| val | the value to compare with |
- Returns:
- bool, true if {*this} angle is smaller than
value
Definition at line 652 of file angle.h.
Is less operator. This test uses Maths::isLess instead of comparing the values directly.
- Parameters:
-
| angle | the angle to compare with |
- Returns:
- bool, true if {*this} angle is smaller than
value
Definition at line 646 of file angle.h.
Is less or equal operator. This test uses Maths::isLessOrEqual instead of comparing the values directly.
- Parameters:
-
| angle | the angle to compare with |
- Returns:
- bool, true if {*this} angle is smaller or equal than
value
Definition at line 658 of file angle.h.
Assignment operator for floats. Assign a float value to the angle. The assigned value has to be in radians!
- Parameters:
-
Definition at line 435 of file angle.h.
Assignment operator
Definition at line 428 of file angle.h.
Equality operator. This test uses Maths::isEqual instead of comparing the values directly.
- Parameters:
-
| angle | the angle to compare with |
- Returns:
- bool, true if the two angles are equal
Definition at line 634 of file angle.h.
Is greater operator. This test uses Maths::isGreater instead of comparing the values directly.
- Parameters:
-
| angle | the angle to compare with |
- Returns:
- bool, true if {*this} angle is greater than
value
Definition at line 670 of file angle.h.
Is greater or equal operator. This test uses Maths::isGreaterOrEqual instead of comparing the values directly.
- Parameters:
-
| angle | the angle to compare with |
- Returns:
- bool, true if {*this} angle is greater or equal than
value
Definition at line 664 of file angle.h.
Assign an Angle object from another.
- Parameters:
-
| angle | the angle object to be assigned from |
Definition at line 414 of file angle.h.
template<typename T>
void BALL::TAngle< T >::set |
( |
const T & |
new_value, |
|
|
bool |
radian = true | |
|
) |
| | [inline] |
Assign a new value to the angle. radian
determines whether new_value
is in radians or in degrees.
- Parameters:
-
| new_value | the value of the angle object |
| radian | true if new_value is in radians, false otherwise |
Definition at line 420 of file angle.h.
Swap the contents of two angles.
Definition at line 406 of file angle.h.
template<typename T>
T BALL::TAngle< T >::toDegree |
( |
const T & |
radian |
) |
[inline, static] |
Calculate degrees from radians
- Parameters:
-
| radian | the value in radians |
- Returns:
- T the value in degrees
Definition at line 481 of file angle.h.
Return the value of the angle
- Returns:
- value in degrees
Definition at line 474 of file angle.h.
template<typename T>
T BALL::TAngle< T >::toRadian |
( |
const T & |
degree |
) |
[inline, static] |
Calculate radians from degrees
- Parameters:
-
| degree | the value in degrees |
- Returns:
- T the value in radians
Definition at line 468 of file angle.h.
Return the value of the angle
- Returns:
- value in radians
Definition at line 462 of file angle.h.
Member Data Documentation