# Point4d Class Reference

## Detailed Description

4D point (vector) class with double type elements Inheritance diagram for Point4d:

## Public Member Functions

Binary operators
Point4 operator+ (const Point4 &p) const

Point4 operator+ (const double &v) const

Point4 operator- (const Point4 &p) const

Point4 operator- (const double &v) const

Point4 operator* (const Point4 &p) const

Point4 operator* (const double &v) const

Point4 operator/ (const Point4 &p) const

Point4 operator/ (const double &v) const

Unary operators
Point4 operator- () const

Set & Get value methods
void Zero ()

void Get (double *p) const

void Set (const double *p)

void Set (const double &v)

void Set (const double &_x, const double &_y, const double &_z, const double &_w=1)

General methods
double LengthSquared () const

double Length () const

void Normalize ()

Point4 GetNormalized () const

double Sum () const

bool IsZero () const

double Min () const

double Max () const

int MinID () const

int MaxID () const

Limit methods
void Clamp (const double &minValue, const double &maxValue)

void ClampMin (const double &v)

void ClampMax (const double &v)

void Abs ()

Assignment operators
const Point4operator+= (const Point4 &p)

const Point4operator+= (const double &v)

const Point4operator-= (const Point4 &p)

const Point4operator-= (const double &v)

const Point4operator*= (const Point4 &p)

const Point4operator*= (const double &v)

const Point4operator/= (const Point4 &p)

const Point4operator/= (const double &v)

Test operators
bool operator== (const Point4 &p) const

bool operator!= (const Point4 &p) const

Access operators
double & operator[] (int i)

const double & operator[] (int i) const

double & Element (int i)

const double & Element (int i) const

double * Data ()

const double * Data () const

Dot product
double Dot (const Point4 &p) const

double operator% (const Point4 &p) const

Conversion Methods
Point2< double > XY () const

Point3< double > XYZ () const

Point3< double > GetNonHomogeneous () const

## Public Attributes

Components of the point/vector
double x

double y

double z

double w

## § Zero()

 void Zero ( )
inherited

Sets the coordinates as zero.

## § Get()

 void Get ( double * p ) const
inherited

Puts the coordinate values into the array.

## § Set() [1/3]

 void Set ( const double * p )
inherited

Sets the coordinates using the values in the given array.

## § Set() [2/3]

 void Set ( const double & v )
inherited

Sets all coordinates using the given value.

## § Set() [3/3]

 void Set ( const double & _x, const double & _y, const double & _z, const double & _w = `1` )
inherited

Sets the coordinates using the given values.

## § LengthSquared()

 double LengthSquared ( ) const
inherited

Returns the square of the length. Effectively, this is the dot product of the vector with itself.

## § Length()

 double Length ( ) const
inherited

Returns the length of the vector.

## § Normalize()

 void Normalize ( )
inherited

Normalizes the vector, such that its length becomes 1.

## § GetNormalized()

 Point4 GetNormalized ( ) const
inherited

Returns a normalized copy of the vector.

## § Sum()

 double Sum ( ) const
inherited

Returns the sum of its components.

## § IsZero()

 bool IsZero ( ) const
inherited

Returns true if all components are exactly zero.

## § Min()

 double Min ( ) const
inherited

Returns the square of the length. Effectively, this is the dot product of the vector with itself.

## § Max()

 double Max ( ) const
inherited

Returns the square of the length. Effectively, this is the dot product of the vector with itself.

## § MinID()

 int MinID ( ) const
inherited

Returns the square of the length. Effectively, this is the dot product of the vector with itself.

## § MaxID()

 int MaxID ( ) const
inherited

Returns the square of the length. Effectively, this is the dot product of the vector with itself.

## § Clamp()

 void Clamp ( const double & minValue, const double & maxValue )
inherited

Converts all negative components to positive values.

## § ClampMin()

 void ClampMin ( const double & v )
inherited

Converts all negative components to positive values.

## § ClampMax()

 void ClampMax ( const double & v )
inherited

Converts all negative components to positive values.

## § Abs()

 void Abs ( )
inherited

Converts all negative components to positive values.

## § Dot()

 double Dot ( const Point4< double > & p ) const
inherited

Dot product.

## § operator%()

 double operator% ( const Point4< double > & p ) const
inherited

Dot product.