1
/////////////////////////////////////////////////////////////
3
// Copyright (c) 2007-2011 by The University of Queensland //
4
// Earth Systems Science Computational Centre (ESSCC) //
5
// http://www.uq.edu.au/esscc //
7
// Primary Business: Brisbane, Queensland, Australia //
8
// Licensed under the Open Software License version 3.0 //
9
// http://www.opensource.org/licenses/osl-3.0.php //
11
/////////////////////////////////////////////////////////////
15
// --- system includes ---
22
m_p=Vector3(0.0,0.0,0.0);
23
m_normal=Vector3(1.0,0.0,0.0);
27
construct plane from origin and normal
29
\param orig a point within the plane
30
\param normal the normal of the plane (will be normalized)
32
Plane::Plane(const Vector3& orig,const Vector3& normal)
35
m_normal=normal.unit();
39
Get the distance of a point from the line
43
double Plane::getDist(const Vector3& p) const
45
return fabs((p-m_p)*m_normal);
48
ostream& operator<< (ostream& ost, const Plane& P)
50
ost << P.m_p << "-" << P.m_normal;