WFMath_Point (3) - Linux Man Pages

WFMath_Point: A dim dimensional point.

NAME

WFMath::Point - A dim dimensional point.

SYNOPSIS


#include <point.h>

Public Member Functions


Point ()
Construct an uninitialized point.
Point (const Point &p)
Construct a copy of a point.
Point (const AtlasInType &a)
Construct a point from an object passed by Atlas.
Point (const Vector< dim > vector)
Construct a point from a vector.
AtlasOutType toAtlas () const
Create an Atlas object from the point.
void fromAtlas (const AtlasInType &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.
CoordType & operator[] (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
CoordType & x ()
access the first component of a point
CoordType y () const
access the second component of a point
CoordType & y ()
access the second component of a point
CoordType z () const
access the third component of a point
CoordType & z ()
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

Static Public Member Functions


static const Point< dim > & ZERO ()
Provides a global instance preset to zero.

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 = 0.5) [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.

Author

Generated automatically by Doxygen for WFMath from the source code.