IpeVector Class Reference
[Ipe Geometry]

Two-dimensional vector. More...

List of all members.

Public Member Functions

Public Attributes

Static Public Attributes

Related Functions

(Note that these are not member functions.)

Detailed Description

Two-dimensional vector.

Unlike some other libraries, I don't make a difference between points and vectors.


Constructor & Destructor Documentation

IpeVector::IpeVector (  )  [inline]

Uninitialized vector.

IpeVector::IpeVector ( IpeAngle  alpha  )  [explicit]

Construct a unit vector with this direction.

IpeVector::IpeVector ( IpeScalar  x,
IpeScalar  y 
) [inline, explicit]

Construct a vector.


Member Function Documentation

double IpeVector::SqLen (  )  const [inline]

Return square of Euclidean length.

IpeAngle IpeVector::Angle (  )  const

Return angle of the vector (with positive x-direction).

Returns zero for the zero vector.

IpeVector IpeVector::Normalized (  )  const

Return this vector normalized (with length one).

IpeVector IpeVector::Orthogonal (  )  const

Return this vector turned 90 degrees to the left.

double IpeVector::Factorize ( IpeVector unit  )  const

Normalizes this vector into unit and returns length. If this is the zero vector, unit is set to (1,0).

bool IpeVector::snap ( const IpeVector mouse,
IpeVector pos,
double &  bound 
) const

Snap to nearby vertex.

If distance between mouse and this vector is less than bound, set pos to this vector and bound to the distance, and return true.

bool IpeVector::operator== ( const IpeVector rhs  )  const [inline]

Equality.

bool IpeVector::operator!= ( const IpeVector rhs  )  const [inline]

Inequality.

void IpeVector::operator+= ( const IpeVector rhs  )  [inline]

Vector-addition.

void IpeVector::operator-= ( const IpeVector rhs  )  [inline]

Vector-subtraction.

void IpeVector::operator *= ( double  rhs  )  [inline]

Multiply vector by scalar.

IpeVector IpeVector::operator+ ( const IpeVector rhs  )  const [inline]

Vector-addition.

IpeVector IpeVector::operator- ( const IpeVector rhs  )  const [inline]

Vector-subtraction.

IpeVector IpeVector::operator * ( double  rhs  )  const [inline]

Vector * scalar.


Friends And Related Function Documentation

IpeVector operator * ( double  lhs,
const IpeVector rhs 
) [related]

Scalar * vector.

double Dot ( const IpeVector lhs,
const IpeVector rhs 
) [related]

Dotproduct of two vectors.


Member Data Documentation

IpeVector IpeVector::Zero [static]

The origin (zero vector).

IpeScalar IpeVector::iX

Vector coordinates are public.


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