MAK Legion API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Legion::Vector2d Class Reference
+ Collaboration diagram for Legion::Vector2d:

Public Member Functions

 Vector2d ()
 
 Vector2d (double x, double y)
 
 Vector2d (const double *tuple)
 
 Vector2d (const Vector2d &other)
 
 Vector2d (const Vector2f &other)
 
Vector2doperator= (const Vector2d &vec)
 
bool operator== (const Vector2d &vec) const
 
bool operator!= (const Vector2d &vec) const
 
bool operator< (const Vector2d &vec) const
 
bool operator<= (const Vector2d &vec) const
 
bool operator> (const Vector2d &vec) const
 
bool operator>= (const Vector2d &vec) const
 
Vector2d operator+ (const Vector2d &vec) const
 
Vector2d operator- (const Vector2d &vec) const
 
Vector2d operator* (double scalar) const
 
Vector2d operator/ (double scalar) const
 
Vector2d operator- () const
 
Vector2doperator+= (const Vector2d &vec)
 
Vector2doperator-= (const Vector2d &vec)
 
Vector2doperator*= (double scalar)
 
Vector2doperator/= (double scalar)
 
double length () const
 
double lengthSquared () const
 
double dot (const Vector2d &vec) const
 
double normalize ()
 
double distanceFrom (const Vector2d &other) const
 
double distanceFromSquared (const Vector2d &other) const
 
void setLength (double newLength)
 
void invert ()
 
bool isZero ()
 
Vector2d perpendicular () const
 
Vector2d unitPerp () const
 
double dotPerp (const Vector2d &vec) const
 
void rotateBy (double degrees, const Vector2d &center)
 rotates the point around a center by an amount of degrees. More...
 
double angleTrig () const
 Calculates the angle of this vector in grad in the trigonometric sense. More...
 
double angle () const
 Calculates the angle of this vector in grad in the counter trigonometric sense. More...
 
double angleBetween (const Vector2d &b) const
 Calculates the angle between this vector and another one in grad. More...
 
bool isBetweenPoints (const Vector2d &begin, const Vector2d &end) const
 Returns if this vector interpreted as a point is on a line between two other points. More...
 

Static Public Member Functions

static Vector2d interpolate (const Vector2d &v0, const Vector2d &v1, double t)
 returns interpolated vector More...
 

Public Attributes

union {
   struct {
      double   x
 
      double   y
 
   } 
 
   double   data [2]
 
}; 
 

Constructor & Destructor Documentation

Legion::Vector2d::Vector2d ( )
Legion::Vector2d::Vector2d ( double  x,
double  y 
)
Legion::Vector2d::Vector2d ( const double *  tuple)
Legion::Vector2d::Vector2d ( const Vector2d other)
Legion::Vector2d::Vector2d ( const Vector2f other)

Member Function Documentation

double Legion::Vector2d::angle ( ) const
inline

Calculates the angle of this vector in grad in the counter trigonometric sense.

Returns
Returns a value between 0 and 360.
double Legion::Vector2d::angleBetween ( const Vector2d b) const
inline

Calculates the angle between this vector and another one in grad.

Returns
Returns a value between 0 and 90.
double Legion::Vector2d::angleTrig ( ) const
inline

Calculates the angle of this vector in grad in the trigonometric sense.

Returns
Returns a value between 0 and 360.
double Legion::Vector2d::distanceFrom ( const Vector2d other) const
inline
double Legion::Vector2d::distanceFromSquared ( const Vector2d other) const
inline
double Legion::Vector2d::dot ( const Vector2d vec) const
inline
double Legion::Vector2d::dotPerp ( const Vector2d vec) const
inline
static Vector2d Legion::Vector2d::interpolate ( const Vector2d v0,
const Vector2d v1,
double  t 
)
static

returns interpolated vector

Parameters
other,:other vector to interpolate between
d,:value between 0.0f and 1.0f.
void Legion::Vector2d::invert ( )
inline
bool Legion::Vector2d::isBetweenPoints ( const Vector2d begin,
const Vector2d end 
) const
inline

Returns if this vector interpreted as a point is on a line between two other points.

It is assumed that the point is on the line.

Parameters
begin,:Beginning vector to compare between.
end,:Ending vector to compare between.
Returns
True if this vector is between begin and end. False if not.
bool Legion::Vector2d::isZero ( )
inline
double Legion::Vector2d::length ( ) const
inline
double Legion::Vector2d::lengthSquared ( ) const
inline
double Legion::Vector2d::normalize ( )
inline
bool Legion::Vector2d::operator!= ( const Vector2d vec) const
inline
Vector2d Legion::Vector2d::operator* ( double  scalar) const
inline
Vector2d& Legion::Vector2d::operator*= ( double  scalar)
inline
Vector2d Legion::Vector2d::operator+ ( const Vector2d vec) const
inline
Vector2d& Legion::Vector2d::operator+= ( const Vector2d vec)
inline
Vector2d Legion::Vector2d::operator- ( const Vector2d vec) const
inline
Vector2d Legion::Vector2d::operator- ( ) const
inline
Vector2d& Legion::Vector2d::operator-= ( const Vector2d vec)
inline
Vector2d Legion::Vector2d::operator/ ( double  scalar) const
inline
Vector2d& Legion::Vector2d::operator/= ( double  scalar)
inline
bool Legion::Vector2d::operator< ( const Vector2d vec) const
inline
bool Legion::Vector2d::operator<= ( const Vector2d vec) const
inline
Vector2d& Legion::Vector2d::operator= ( const Vector2d vec)
inline
bool Legion::Vector2d::operator== ( const Vector2d vec) const
inline
bool Legion::Vector2d::operator> ( const Vector2d vec) const
inline
bool Legion::Vector2d::operator>= ( const Vector2d vec) const
inline
Vector2d Legion::Vector2d::perpendicular ( ) const
inline
void Legion::Vector2d::rotateBy ( double  degrees,
const Vector2d center 
)
inline

rotates the point around a center by an amount of degrees.

void Legion::Vector2d::setLength ( double  newLength)
inline
Vector2d Legion::Vector2d::unitPerp ( ) const
inline

Member Data Documentation

union { ... }
double Legion::Vector2d::data[2]
double Legion::Vector2d::x
double Legion::Vector2d::y

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

Document ID: Generated on Mon Mar 8 15:11:30 EST 2021 from SVN revision 225633
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)