Main Page | Class Hierarchy | Class List | Class Members

Point3D Class Reference

List of all members.

Public Member Functions

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

Public Attributes

double p [3]

Detailed Description

This class represents a 3D vector


Member Function Documentation

Point3D Point3D::add const Point3D pt  )  const
 

This method adds two points and returns their sum.

Point3D Point3D::crossProduct const Point3D pt  )  const
 

This method returns the cross-product of two points.

Point3D Point3D::div const Point3D pt  )  const
 

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

double Point3D::dot const Point3D pt  )  const
 

This method returns the dot product of two points.

double & Point3D::index const int &  i  ) 
 

This method returns the value of the indexed coefficient.

double Point3D::length void   )  const
 

This method returns the length of a point.

Point3D Point3D::mult const Point3D pt  )  const
 

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

Point3D Point3D::negate void   )  const
 

This method return the negative of the point.

Point3D Point3D::operator * const Point3D pt  )  const
 

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

Point3D Point3D::operator * double  scale  )  const
 

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

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

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

Point3D & Point3D::operator *= double  scale  ) 
 

This method scales the current point by a constant factor.

Point3D Point3D::operator+ const Point3D pt  )  const
 

This method adds two points and returns their sum.

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

This method adds a point to the current point.

Point3D Point3D::operator- const Point3D pt  )  const
 

This method subtracts two points and returns their difference.

Point3D Point3D::operator- void   )  const
 

This method return the negative of the point.

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

This method subtracts a point from the current point.

Point3D Point3D::operator/ const Point3D pt  )  const
 

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

Point3D Point3D::operator/ double  scale  )  const
 

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

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

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

Point3D & Point3D::operator/= double  scale  ) 
 

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

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

This method returns the value of the indexed coefficient.

Point3D Point3D::operator^ const Point3D pt  )  const
 

This method returns the cross-product of two points.

Point3D & Point3D::operator^= const Point3D pt  ) 
 

This method set the current point to be equal to the cross-product of itself with the input point.

Point3D Point3D::scale double  scale  )  const
 

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

double Point3D::squareNorm void   )  const
 

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

Point3D Point3D::subtract const Point3D pt  )  const
 

This method subtracts two points and returns their difference.

Point3D Point3D::unit void   )  const
 

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


Member Data Documentation

double Point3D::p[3]
 

The coordinates of the point


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