32 template<
class Po
int,
class Po
intRef,
class polygonRef>
44 template<
class Po
int,
class Po
intRef,
class polygonRef>
48 is.
check(
"pyramid::pyramid(Istream&)");
54 template<
class Po
int,
class Po
intRef,
class polygonRef>
60 template<
class Po
int,
class Po
intRef,
class polygonRef>
67 template<
class Po
int,
class Po
intRef,
class polygonRef>
73 return (3.0/4.0)*base_.centre(points) + (1.0/4.0)*apex_;
77 template<
class Po
int,
class Po
intRef,
class polygonRef>
84 return (apex_ - base_.centre(points));
88 template<
class Po
int,
class Po
intRef,
class polygonRef>
94 return (1.0/3.0)*(base_.area(points)&(height(points)));
100 template<
class Po
int,
class Po
intRef,
class polygonRef>
107 is >>
p.base_ >>
p.apex_;
108 is.check(
"Istream& operator>>(Istream&, pyramid&)");
113 template<
class Po
int,
class Po
intRef,
class polygonRef>
120 os <<
p.base_ <<
tab <<
p.apex_ <<
nl;
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
scalar mag(const pointField &points) const
Return scalar magnitude - returns volume of pyramid.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
polygonRef base() const
Return base polygon.
const Point & apex() const
Return apex point.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
vector height(const pointField &points) const
Return height vector.
Point centre(const pointField &points) const
Return centre (centroid)
pyramid(polygonRef base, const Point &apex)
Construct from base polygon and apex point.
A geometric pyramid primitive with a base of 'n' sides: i.e. a parametric pyramid. A pyramid is constructed from a base polygon and an apex point.