#include <BaryCoordSystem.h>
Public Member Functions | |
BaryCoordSystem () | |
Empty default constructor. | |
BaryCoordSystem (const Array< double, Dim > *corners) | |
Constructor. | |
void | setCorners (const Array< double, Dim > *corners) |
Set corners. | |
const Array< double, Dim > & | corner (int i) const |
Returns the corner points. | |
template<class T> | |
Array< T, Dim > | baryToCart (const Array< T, Dim+1 > &bary_pt) const |
Input is a barycentric point, output is the corresponding cartesian point. | |
template<class T> | |
Array< T, Dim+1 > | cartToBary (const Array< T, Dim > &cart_pt) const |
Input is a cartesian point, output is the corresponding barycentric point. | |
void | read (std::istream &is) |
Read from input stream. | |
void | write (std::ostream &os) const |
Write to output stream. |
It is designed to work in any dimension, but at the time of writing, only dimension 2 and 3 is supported by the functions in the included header "Volumes.h"
You specify the dimension with a template parameter:
BaryCoordSystem<2> bc(corner_pointer);
... or by using the supplied typedefs:
BaryCoordSystem2D bc(corner_pointer);
This file also contains the small function called triangle_area_signed().
Definition at line 64 of file BaryCoordSystem.h.
Go::BaryCoordSystem< Dim >::BaryCoordSystem | ( | const Array< double, Dim > * | corners | ) | [inline] |
Constructor.
Takes an array of points that will become the corners of the coordinate simplex.
Definition at line 71 of file BaryCoordSystem.h.
References Go::simplex_volume().