2D (x,y) point structure - Double More...
#include <point.h>
Public Types | |
typedef double | datatype |
Public Member Functions | |
Pointd () | |
Pointd (double x, double y) | |
Pointd (const Pointx< double > &p) | |
Pointd (const Vec2< double > &p) | |
Attributes | |
Vec2< double > & | normalize () |
Normalizes this vector. More... | |
double | dot (const Vec2< double > &vector) const |
Dot products this vector with an other vector. More... | |
Vec2< double > & | round () |
Rounds all components of this vector. More... | |
Vec2< double > & | rotate (const Vec2< double > &hotspot, const Angle &angle) |
Rotate this vector around another point. More... | |
bool | is_equal (const Vec2< double > &other, doubleepsilon) const |
Returns true if equal within the bounds of an epsilon. More... | |
double | length () const |
Returns the length (magnitude) of this vector. More... | |
Angle | angle (const Vec2< double > &vector) const |
Calculate the angle between this vector and an other vector. More... | |
Angle | angle_normed (const Vec2< double > &vector) const |
Calculate the angle between this vector and an other vector, where the vectors are unit vectors. More... | |
Angle | angle_line (const Vec2< double > &point) const |
Calculate the angle of the line joining this point and other point. More... | |
double | distance (const Vec2< double > &vector) const |
Calculate the distance between this vector and an other vector. More... | |
double | round_value (float value) const |
Rounds a value for the datatype. More... | |
Operators | |
void | operator+= (const Vec2< double > &vector) |
+= operator. More... | |
void | operator+= (doublevalue) |
+= operator. More... | |
void | operator-= (const Vec2< double > &vector) |
-= operator. More... | |
void | operator-= (doublevalue) |
-= operator. More... | |
Vec2< double > | operator- () const |
| |
void | operator*= (const Vec2< double > &vector) |
*= operator. More... | |
void | operator*= (doublevalue) |
*= operator. More... | |
void | operator/= (const Vec2< double > &vector) |
/= operator. More... | |
void | operator/= (doublevalue) |
/= operator. More... | |
bool | operator== (const Vec2< double > &vector) const |
== operator. More... | |
bool | operator!= (const Vec2< double > &vector) const |
!= operator. More... | |
bool | operator< (const Vec2< double > &vector) const |
< operator. More... | |
Static Public Member Functions | |
static Pointx< double > | calc_origin (Origin origin, const Sizex< double > &size) |
Returns the anchor point for the origin within the dimensions of the size structure. More... | |
static double | dot (const Vec2< double > &vector_1, const Vec2< double > &vector_2) |
Dot products a vector with an other vector. More... | |
static bool | is_equal (const Vec2< double > &first, const Vec2< double > &second, doubleepsilon) |
Returns true if equal within the bounds of an epsilon. More... | |
static Vec2< double > | normalize (const Vec2< double > &vector) |
Normalizes a vector. More... | |
static Vec2< double > | rotate (const Vec2< double > &vector, const Vec2< double > &hotspot, const Angle &angle) |
Rotate a vector around another point. More... | |
static Vec2< double > | round (const Vec2< double > &vector) |
Rounds all components on a vector. More... | |
Public Attributes | |
union { | |
Type clan::Vec2< Type >::r | |
Type clan::Vec2< Type >::s | |
Type clan::Vec2< Type >::x | |
}; | |
union { | |
Type clan::Vec2< Type >::g | |
Type clan::Vec2< Type >::t | |
Type clan::Vec2< Type >::y | |
}; | |
double | g |
double | r |
double | s |
double | t |
double | x |
double | y |
2D (x,y) point structure - Double
|
inherited |
|
inherited |
Calculate the angle between this vector and an other vector.
vector | = Second vector used to calculate angle. |
|
inherited |
Calculate the angle of the line joining this point and other point.
point | = Second point in the line |
|
inherited |
Calculate the angle between this vector and an other vector, where the vectors are unit vectors.
vector | = Second vector used to calculate angle. |
|
staticinherited |
Returns the anchor point for the origin within the dimensions of the size structure.
origin | = The origin |
size | = The size |
|
inherited |
Calculate the distance between this vector and an other vector.
vector | = Second vector used to calculate distance. |
|
inlinestaticinherited |
Dot products a vector with an other vector.
Operates in the native datatype
vector_1 | = First vector used for the dot product. |
vector_2 | = Second vector used for the dot product. |
|
inlineinherited |
Dot products this vector with an other vector.
Operates in the native datatype
vector | Second vector used for the dot product. |
|
inlinestaticinherited |
Returns true if equal within the bounds of an epsilon.
first | = Value A |
second | = Value B |
epsilon | = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) |
|
inlineinherited |
Returns true if equal within the bounds of an epsilon.
other | = Other value |
epsilon | = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) |
|
inherited |
Returns the length (magnitude) of this vector.
Operates in the native datatype
|
staticinherited |
Normalizes a vector.
Operates in the native datatype
vector | = Vector to use |
|
inherited |
Normalizes this vector.
Operates in the native datatype
|
inlineinherited |
!= operator.
|
inlineinherited |
*= operator.
|
inlineinherited |
*= operator.
|
inlineinherited |
+= operator.
|
inlineinherited |
+= operator.
|
inlineinherited |
|
inlineinherited |
-= operator.
|
inlineinherited |
-= operator.
|
inlineinherited |
/= operator.
|
inlineinherited |
/= operator.
|
inlineinherited |
< operator.
|
inlineinherited |
== operator.
|
staticinherited |
Rotate a vector around another point.
vector | = Vector to use |
hotspot | The point around which to rotate. |
angle | = Angle to rotate. |
|
inherited |
Rotate this vector around another point.
hotspot | The point around which to rotate. |
angle | = Angle to rotate. |
|
staticinherited |
Rounds all components on a vector.
Uses Asymmetric Arithmetic Rounding
vector | = Vector to use |
|
inherited |
Rounds all components of this vector.
Uses Asymmetric Arithmetic Rounding
|
inherited |
Rounds a value for the datatype.
For doubles and floats, this function does not round.
value | = Value to round |
union { ... } |
union { ... } |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |