Ipelib: IpeVector class Reference

Main Page | Modules | Class Hierarchy | Class List | Class Members

# IpeVector Class Reference
[Ipe Geometry]

Two-dimensional vector. More...

List of all members.

## Public Member Functions

- IpeVector ()
- IpeVector (IpeAngle alpha)
- IpeVector (IpeScalar x, IpeScalar y)
- double SqLen () const
- double Len () const
- IpeAngle Angle () const
- IpeVector Normalized () const
- IpeVector Orthogonal () const
- double Factorize (IpeVector &unit) const
- bool operator== (const IpeVector &rhs) const
- bool operator!= (const IpeVector &rhs) const
- void operator+= (const IpeVector &rhs)
- void operator-= (const IpeVector &rhs)
- void operator *= (double rhs)
- IpeVector operator+ (const IpeVector &rhs) const
- IpeVector operator- (const IpeVector &rhs) const
- IpeVector operator * (double rhs) const

## Public Attributes

- IpeScalar iX
- IpeScalar iY

## Static Public Attributes

- IpeVector Zero = IpeVector(0.0, 0.0)

## 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::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.

## Member Data Documentation

IpeVector IpeVector::Zero = IpeVector(0.0, 0.0)`[static]`

| The origin (zero vector).

IpeScalar IpeVector::iX

| { Vector coordinates are public.

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

- ipegeo.h
- ipegeo.cpp