38 this->
x = rhs[0]; this->
y = rhs[1];
70 return x*rhs.
x +
y*rhs.
y;
83 return x*rhs.
x+
y*rhs.
y;
86 return y*rhs.
x-
x*rhs.
y;
97 #ifdef _THERE_IS_NO_ATAN2_ 106 float dhn = (dh < 0) ? 1.0 : 0.0;
109 psi = M_PI_2 * (dvp + 3.0 * dvn);
113 psi = atan(dv/dh) +
M_PI * dhn * dvp
115 return psi * (180.0*
M_1_PI);
181 bool clamp(
float x0,
float y0,
float x1,
float y1)
187 os << p.
x <<
" " << p.
y;
212 float ca = cos(angle);
213 float sa = sin(angle);
217 return lhs.
x == rhs.
x && lhs.
y == rhs.
y;
Point2D & operator*=(const float f)
Point2D & operator/=(const Point2D &rhs)
IPoint2D(int _i, const Point2D &p)
Point2D operator+(const Point2D &rhs) const
Point2D operator-(const Point2D &rhs) const
const Point2D & const_times(const Point2D &rhs) const
bool clamp(T &x, T &y, const T x0, const T y0, const T x1, const T y1)
friend std::istream & operator>>(std::istream &is, Point2D &p)
friend std::ostream & operator<<(std::ostream &os, const Point2D &p)
Point2D(const Point2D &rhs)
float norm() const
returns 2-norm aka length or absolute
Point2D & operator*=(const Point2D &rhs)
Point2D & operator=(float rhs)
Point2D & operator=(const Point2D &rhs)
Point2D(float _x, float _y)
Point2D & operator-=(const Point2D &rhs)
Point2D & operator+=(const Point2D &rhs)
friend bool operator!=(const Point2D &lhs, const Point2D &rhs)
float normalize()
normalizes the vector; returns old norm
float sum() const
returns 1-norm
float angle(const Point2D &rhs=Point2D(1, 0)) const
Point2D operator/(float rhs) const
IPoint2D(int _i, float _x, float _y)
const Point2D rotate(float angle) const
Point2D operator*(float rhs) const
bool clamp(float x0, float y0, float x1, float y1)
const Point2D copyNormalized() const
const Point2D flipOrtho() const
float sinAngle(const Point2D &rhs) const
Point2D(const float *val)
Point2D & operator/=(const float f)
friend bool operator==(const Point2D &lhs, const Point2D &rhs)
Point2D & operator=(const float *rhs)
float crossZ(const Point2D &rhs) const
Point2D & times(const Point2D &rhs)
float norm2() const
returns squared 2-norm
float operator*(const Point2D &rhs) const
void glVertex() const
Issue a glVertex2f call.
float dot(const Point2D &rhs) const
Point2D operator/(const Point2D &rhs) const
DMatrix< T > & sqrt(DMatrix< T > &mat)