#include <point2i.H>
Descriptive interface | |
typedef int | value_type |
static int | dim () |
Public Member Functions | |
Constructors | |
Vec2i () | |
Default Constructor. Creates a zero vector. | |
Vec2i (int x, int y) | |
Constructor that creates a vector with the components specified in the arguments. | |
Overloaded Arithmetic Operators | |
Vec2i | operator+ (Cvec2i &v) const |
Vec2i | operator- (Cvec2i &v) const |
int | operator * (Cvec2i &v) const |
Vec2i | operator- () const |
void | operator+= (Cvec2i &v) |
void | operator-= (Cvec2i &v) |
Element Access Functions | |
int | operator[] (int index) const |
int & | operator[] (int index) |
Vector Property Queries | |
double | length () const |
int | length_sqrd () const |
int | is_null () const |
Are the vector's components both equal to zero? | |
Vector Operations | |
Vec2i | perpend () const |
Two Vector Operations | |
double | dist (Cvec2i &v) const |
Computes the distance between two vectors treated as position vectors. | |
int | dist_sqrd (Cvec2i &v) const |
Computes the distance squared between two vectors treated as position vectors. | |
Overloaded Comparison Operators | |
int | operator== (Cvec2i &v) const |
Are the two vectors exactly equal? | |
int | operator!= (Cvec2i &v) const |
Are the two vectors not equal? | |
Protected Attributes | |
int | _x |
int | _y |
Friends | |
Overloaded Stream Operators | |
ostream & | operator<< (ostream &os, Cvec2i &v) |
Stream insertion operator for Vec2i class. | |
Related Functions | |
(Note that these are not member functions.) | |
typedef const Vec2i | Cvec2i |
Shortcut for const Vec2i. |
Definition at line 27 of file point2i.H.
|
|
|
Default Constructor. Creates a zero vector.
Definition at line 40 of file point2i.H. Referenced by operator+(), operator-(), and perpend(). |
|
Constructor that creates a vector with the components specified in the arguments.
|
|
|
|
Computes the distance between two vectors treated as position vectors.
|
|
Computes the distance squared between two vectors treated as position vectors.
|
|
Are the vector's components both equal to zero?
|
|
|
|
|
|
|
|
Are the two vectors not equal?
|
|
|
|
|
|
|
|
|
|
|
|
Are the two vectors exactly equal?
|
|
Definition at line 75 of file point2i.H. References _x. |
|
Definition at line 74 of file point2i.H. References _x. |
|
|
|
Shortcut for const Vec2i.
|
|
Stream insertion operator for Vec2i class.
|
|
Definition at line 32 of file point2i.H. Referenced by is_null(), length(), length_sqrd(), operator *(), operator!=(), operator+(), operator+=(), operator-(), operator-=(), operator==(), operator[](), and perpend(). |
|
Definition at line 32 of file point2i.H. Referenced by is_null(), length(), length_sqrd(), operator *(), operator!=(), operator+(), operator+=(), operator-(), operator-=(), operator==(), and perpend(). |