Main Page | Class Hierarchy | Class List | Class Members

Point2D Class Reference

List of all members.

Public Member Functions

double & operator[] (const int &index)
double & index (const int &i)
double dot (const Point2D &pt) const
double length (void) const
double squareNorm (void) const
Point2D unit (void) const
Point2D negate (void) const
Point2D operator- (void) const
Point2D scale (double scl) const
Point2D operator * (double scale) const
Point2Doperator *= (double scale)
Point2D operator/ (double scale) const
Point2Doperator/= (double scale)
Point2D add (const Point2D &pt) const
Point2D operator+ (const Point2D &pt) const
Point2Doperator+= (const Point2D &pt)
Point2D subtract (const Point2D &pt) const
Point2D operator- (const Point2D &pt) const
Point2Doperator-= (const Point2D &pt)
Point2D mult (const Point2D &pt) const
Point2D operator * (const Point2D &pt) const
Point2Doperator *= (const Point2D &pt)
Point2D div (const Point2D &pt) const
Point2D operator/ (const Point2D &pt) const
Point2Doperator/= (const Point2D &pt)

Public Attributes

double p [2]

Detailed Description

This class represents a 2D vector


Member Function Documentation

Point2D Point2D::add const Point2D pt  )  const
 

This method adds two points and returns their sum.

Point2D Point2D::div const Point2D pt  )  const
 

This method performs a component-wise division of two ponts and returns the ratio.

double Point2D::dot const Point2D pt  )  const
 

This method returns the dot product of two points.

double & Point2D::index const int &  i  ) 
 

This method returns the value of the indexed coefficient.

double Point2D::length void   )  const
 

This method returns the length of a point.

Point2D Point2D::mult const Point2D pt  )  const
 

This method performs a component-wise multiplication of two ponts and returns the product.

Point2D Point2D::negate void   )  const
 

This method return the negative of the point.

Point2D Point2D::operator * const Point2D pt  )  const
 

This method performs a component-wise multiplication of two ponts and returns the product.

Point2D Point2D::operator * double  scale  )  const
 

This method scales a point by a constant factor and returns a new point.

Point2D & Point2D::operator *= const Point2D pt  ) 
 

This method multiplies the coefficients of the current point by the coefficients of the input point.

Point2D & Point2D::operator *= double  scale  ) 
 

This method scales the current point by a constant factor.

Point2D Point2D::operator+ const Point2D pt  )  const
 

This method adds two points and returns their sum.

Point2D & Point2D::operator+= const Point2D pt  ) 
 

This method adds a point to the current point.

Point2D Point2D::operator- const Point2D pt  )  const
 

This method subtracts two points and returns their difference.

Point2D Point2D::operator- void   )  const
 

This method return the negative of the point.

Point2D & Point2D::operator-= const Point2D pt  ) 
 

This method subtracts a point from the current point.

Point2D Point2D::operator/ const Point2D pt  )  const
 

This method performs a component-wise division of two ponts and returns the ratio.

Point2D Point2D::operator/ double  scale  )  const
 

This method divides the coefficients of a point by a constant factor and returns a new point.

Point2D & Point2D::operator/= const Point2D pt  ) 
 

This method divides the coefficients of the current point by the coefficients of the input point.

Point2D & Point2D::operator/= double  scale  ) 
 

This method divides the coefficients of the current point by a constant factor.

double & Point2D::operator[] const int &  index  ) 
 

This method returns the value of the indexed coefficient.

Point2D Point2D::scale double  scl  )  const
 

This method scales a point by a constant factor and returns a new point.

double Point2D::squareNorm void   )  const
 

This method returns the square of the length of a point.

Point2D Point2D::subtract const Point2D pt  )  const
 

This method subtracts two points and returns their difference.

Point2D Point2D::unit void   )  const
 

This method returns a unit vector that points in the same direction as the point.


Member Data Documentation

double Point2D::p[2]
 

The coordinates of the point


Generated on Wed Feb 22 15:44:23 2006 for Assignment 2 by  doxygen 1.4.1