Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
|
Describes an angle, and allows for easy conversion between various units. More...
#include <hdicoreAngle.h>
Public Types | |
enum | Units { Radians = 1 , Degrees = 2 , Gradians = 3 , Turns = 4 } |
Units supported for angle calculations. | |
Public Member Functions | |
Angle () | |
Default Angle constructor; sets the angle to 0.0 radians. | |
Angle (const double value_, const Units units_=Radians) | |
Angle constructor; sets the angle to the provided value. | |
Angle (const Angle &angle_) | |
Angle copy constructor. | |
virtual | ~Angle () |
Angle destructor. | |
virtual bool | equalWithinTol (const Angle &compare_, const Angle &tol_) const |
Checks for two angles being within a given tolerance of one another. | |
virtual bool | operator== (const Angle &rhs_) const |
Compares two angles for equality. | |
virtual bool | operator!= (const Angle &rhs_) const |
Compares two angles for inequality. | |
virtual bool | operator< (const Angle &rhs_) const |
Checks if the target angle's value is less than the provided angle's. | |
virtual bool | operator<= (const Angle &rhs_) const |
Checks if the target angle's value is less than or equal to the provided angle's. | |
virtual bool | operator> (const Angle &rhs_) const |
Checks if the target angle's value is greater than the provided angle's. | |
virtual bool | operator>= (const Angle &rhs_) const |
Checks if the target angle's value is greater than or equal to the provided angle's. | |
virtual Angle | operator- () const |
Flips the sign of the target angle. | |
virtual Angle | operator+ (const Angle &rhs_) const |
Allows two Angle objects to be added together with the + operator. | |
virtual Angle | operator- (const Angle &rhs_) const |
Allows one Angle object to be substracted from another with the - operator. | |
virtual Angle | operator* (const Angle &rhs_) const |
Allows two Angle objects to be multipled together with the * operator. | |
virtual Angle | operator/ (const Angle &rhs_) const |
Allows one Angle object to be divided by another with the / operator. | |
virtual Angle & | operator= (const Angle &rhs_) |
Allows one Angle object to be assigned from another. | |
virtual Angle & | operator+= (const Angle &rhs_) |
Allows two Angle objects to be added together with the + operator, assigning the lefthand object. | |
virtual Angle & | operator-= (const Angle &rhs_) |
Allows one Angle object to be substracted from another with the - operator, assigning the lefthand object. | |
virtual Angle & | operator*= (const Angle &rhs_) |
Allows two Angle objects to be multipled together with the * operator, assigning the lefthand object. | |
virtual Angle & | operator/= (const Angle &rhs_) |
Allows one Angle object to be divided by another with the / operator, assigning the lefthand object. | |
virtual Angle | operator* (const double rhs_) const |
Allows an Angle object to be multipled by a constant. | |
virtual Angle | operator/ (const double rhs_) const |
Allows an Angle object to be divided by a constant. | |
virtual Angle & | operator*= (const double rhs_) |
Allows an Angle object to be multipled by a constant, assigning the lefthand object. | |
virtual Angle & | operator/= (const double rhs_) |
Allows an Angle object to be divided by a constant, assigning the lefthand object. | |
virtual double | asRadians () const |
Gets the value of the target object in radians. | |
virtual double | asDegrees () const |
Gets the value of the target object in degrees. | |
virtual double | asGradians () const |
Gets the value of the target object in gradians. | |
virtual double | asTurns () const |
Gets the value of the target object in turns. | |
virtual double | valueInUnits (const Units units_=Radians) const |
Gets the value of the target object in the given units. | |
virtual void | setValueInUnits (const double value_, const Units units_=Radians) |
Sets the value of the target object in the given units. | |
virtual Angle | range0To2Pi () const |
Changes the range of the angle value to be in [0,2pi]. | |
virtual Angle | rangeNegPiToPi () const |
Changes the range of the angle value to be in [-pi,pi]. | |
virtual Angle | nearest45 () const |
Constrains an angle to the nearest 45-degree (pi/4) interval. | |
virtual Angle | constrain0ToPi () const |
Constrains the target Angle object's value to the range [0,pi]. | |
virtual Angle | constrainPiOver2To3PiOver2 () const |
Constrains the target Angle object's value to the range [pi/2,3pi/2]. | |
virtual Angle | constrainPiTo2Pi () const |
Constrains the target Angle object's value to the range [pi,2pi]. | |
virtual Angle | constrainNegPiOver2ToPiOver2 () const |
Constrains the target Angle object's value to the range [-pi/2,pi/2]. | |
virtual Angle | bisect (const Angle &angle2_) const |
Gets the bisection of the target Angle with a provided Angle on their most acute "side". | |
virtual Angle | delta (const Angle &angle2_) const |
Gets the delta between the target Angle and a provided Angle object. | |
virtual bool | firstQuadrant () const |
Tests if the target Angle lies in the first quadrant, were it from point (0,0) | |
virtual bool | secondQuadrant () const |
Tests if the target Angle lies in the second quadrant, were it from point (0,0) | |
virtual bool | thirdQuadrant () const |
Tests if the target Angle lies in the third quadrant, were it from point (0,0) | |
virtual bool | fourthQuadrant () const |
Tests if the target Angle lies in the fourth quadrant, were it from point (0,0) | |
virtual int16_t | quadrantNumber () const |
Gets the quadrant number for the target Angle, were it from point (0,0) | |
virtual double | sin (const double tol_=10000.0 *maxDoublePrecision) const |
"Safely" computes the sine of an angle | |
virtual double | cos (const double tol_=10000.0 *maxDoublePrecision) const |
"Safely" computes the cosine of an angle | |
virtual double | tan (const double tol_=10000.0 *maxDoublePrecision) const |
"Safely" computes the tangent of an angle | |
Static Public Member Functions | |
static Angle | asin (const double val_, const double tol_=10000.0 *maxDoublePrecision) |
"Safely" computes the angle for a given sine value | |
static Angle | acos (const double val_, const double tol_=10000.0 *maxDoublePrecision) |
"Safely" computes the angle for a given cosine value | |
static Angle | atan (const double val_, const double tol_=10000.0 *maxDoublePrecision) |
"Safely" computes the angle for a given tangent value | |
static Angle | Zero () |
Convenience method to construct an Angle object for zero radians, degrees, etc. | |
static Angle | Pi () |
Convenience method to construct an Angle object for pi radians. | |
static Angle | TwoPi () |
Convenience method to construct an Angle object for 2*pi radians. | |
Friends | |
geo::Angle * | __accessImpl (const Angle &) |
Angle | __accessCtor (const geo::Angle &) |
Describes an angle, and allows for easy conversion between various units.
hdi::core::Angle::Angle | ( | ) |
Default Angle constructor; sets the angle to 0.0 radians.
hdi::core::Angle::Angle | ( | const double | value_, |
const Units | units_ = Radians |
||
) |
hdi::core::Angle::Angle | ( | const Angle & | angle_ | ) |
|
virtual |
Angle destructor.
|
static |
"Safely" computes the angle for a given cosine value
val_ | Cosine value, whose corresponding angle is required |
tol_ | Tolerance around zero, whereupon the returned value will be rounded to 0.0 |
|
virtual |
Gets the value of the target object in degrees.
|
virtual |
Gets the value of the target object in gradians.
|
static |
"Safely" computes the angle for a given sine value
val_ | Sine value, whose corresponding angle is required |
tol_ | Tolerance around zero, whereupon the returned value will be rounded to 0.0 |
|
virtual |
Gets the value of the target object in radians.
|
virtual |
Gets the value of the target object in turns.
|
static |
"Safely" computes the angle for a given tangent value
val_ | Tangent value, whose corresponding angle is required |
tol_ | Tolerance around zero, whereupon the returned value will be rounded to 0.0 |
|
virtual |
Constrains the target Angle object's value to the range [0,pi].
|
virtual |
Constrains the target Angle object's value to the range [-pi/2,pi/2].
|
virtual |
Constrains the target Angle object's value to the range [pi/2,3pi/2].
|
virtual |
Constrains the target Angle object's value to the range [pi,2pi].
|
virtual |
"Safely" computes the cosine of an angle
tol_ | Tolerance around zero, whereupon the returned value will be rounded to 0.0 |
|
virtual |
Checks for two angles being within a given tolerance of one another.
compare_ | Angle to compare against the target object |
tol_ | Allowable tolerance between the two objects, for them to be considered "equal" |
|
virtual |
|
virtual |
|
virtual |
Constrains an angle to the nearest 45-degree (pi/4) interval.
|
virtual |
Compares two angles for inequality.
rhs_ | Righthand side of the != operator; the angle to compare against |
Allows two Angle objects to be multipled together with the * operator.
rhs_ | Righthand side of the * operator; the angle to multiply by the target |
|
virtual |
Allows an Angle object to be multipled by a constant.
rhs_ | Righthand side of the * operator; the constant to multiply against the target |
|
virtual |
Allows two Angle objects to be added together with the + operator.
rhs_ | Righthand side of the + operator; the angle to add to the target |
|
virtual |
Flips the sign of the target angle.
Allows one Angle object to be substracted from another with the - operator.
rhs_ | Righthand side of the - operator; the angle to subtract from the target |
Allows one Angle object to be divided by another with the / operator.
rhs_ | Righthand side of the / operator; the angle to divide into the target |
|
virtual |
Allows an Angle object to be divided by a constant.
rhs_ | Righthand side of the / operator; the constant to divide into the target |
|
virtual |
|
virtual |
Checks if the target angle's value is less than the provided angle's.
rhs_ | Righthand side of the < operator; the angle to compare against |
|
virtual |
Checks if the target angle's value is less than or equal to the provided angle's.
rhs_ | Righthand side of the <= operator; the angle to compare against |
|
virtual |
Compares two angles for equality.
rhs_ | Righthand side of the == operator; the angle to compare against |
|
virtual |
Checks if the target angle's value is greater than the provided angle's.
rhs_ | Righthand side of the > operator; the angle to compare against |
|
virtual |
Checks if the target angle's value is greater than or equal to the provided angle's.
rhs_ | Righthand side of the >= operator; the angle to compare against |
|
static |
|
virtual |
Gets the quadrant number for the target Angle, were it from point (0,0)
|
virtual |
Changes the range of the angle value to be in [0,2pi].
|
virtual |
Changes the range of the angle value to be in [-pi,pi].
|
virtual |
|
virtual |
Sets the value of the target object in the given units.
value_ | Value, in "units_" units, to set |
units_ | Units for the value_ argument |
|
virtual |
"Safely" computes the sine of an angle
tol_ | Tolerance around zero, whereupon the returned value will be rounded to 0.0 |
|
virtual |
"Safely" computes the tangent of an angle
tol_ | Tolerance around zero, whereupon the returned value will be rounded to 0.0 |
|
virtual |
|
static |
|
virtual |
Gets the value of the target object in the given units.
units_ | Desired units for the return value |