Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

WFMath::Point< dim > Class Template Reference

A dim dimensional point. More...

#include <point.h>

List of all members.

Public Member Functions

 Point ()
 Construct an uninitialized point.

 Point (const Point &p)
 Construct a copy of a point.

 Point (const Atlas::Message::Object &a)
 Construct a point from an object passed by Atlas.

Atlas::Message::Object toAtlas () const
 Create an Atlas object from the point.

void fromAtlas (const Atlas::Message::Object &a)
 Set the point's value to that given by an Atlas object.

void setValid (bool valid=true)
 make isValid() return true if you've initialized the point by hand

Point & setToOrigin ()
 Set point to (0,0,...,0).

Point & rotate (const RotMatrix< dim > &m, const Point &p)
 Rotate about point p.

CoordType operator[] (const int i) const
 Access the i'th coordinate of the point.

CoordTypeoperator[] (const int i)
 Access the i'th coordinate of the point.

 Point (CoordType x, CoordType y)
 2D only: construct a point from its (x, y) coordinates

 Point (CoordType x, CoordType y, CoordType z)
 3D only: construct a point from its (x, y, z) coordinates

CoordType x () const
 access the first component of a point

CoordTypex ()
 access the first component of a point

CoordType y () const
 access the second component of a point

CoordTypey ()
 access the second component of a point

CoordType z () const
 access the third component of a point

CoordTypez ()
 access the third component of a point

Point< 2 > & polar (CoordType r, CoordType theta)
 2D only: construct a vector from polar coordinates

void asPolar (CoordType &r, CoordType &theta) const
 2D only: convert a vector to polar coordinates

Point< 3 > & polar (CoordType r, CoordType theta, CoordType z)
 3D only: construct a vector from polar coordinates

void asPolar (CoordType &r, CoordType &theta, CoordType &z) const
 3D only: convert a vector to polar coordinates

Point< 3 > & spherical (CoordType r, CoordType theta, CoordType phi)
 3D only: construct a vector from spherical coordinates

void asSpherical (CoordType &r, CoordType &theta, CoordType &phi) const
 3D only: convert a vector to spherical coordinates


Friends

CoordType SquaredDistance (const Point &p1, const Point &p2)
 Get the square of the distance from p1 to p2.

Point< dim > Midpoint (const Point &p1, const Point &p2, CoordType dist)
 Find a point on the line containing p1 and p2, by default the midpoint.


Detailed Description

template<const int dim>
class WFMath::Point< dim >

A dim dimensional point.

This class implements the full shape interface, as described in the fake class Shape.


Friends And Related Function Documentation

template<const int dim>
Point<dim> Midpoint const Point< dim > &    p1,
const Point< dim > &    p2,
CoordType    dist
[friend]
 

Find a point on the line containing p1 and p2, by default the midpoint.

The default value of 0.5 for dist gives the midpoint. A value of 0 gives p1, and 1 gives p2. Values of dist outside the [0, 1] range are allowed, and give points on the line which are not on the segment bounded by p1 and p2.


The documentation for this class was generated from the following files:
Generated on Wed May 28 09:20:33 2003 for WFMath by doxygen1.3-rc3