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
/////////////////////////////////////////////////////////////
19
Cylinder::Cylinder(const Vector3& c,const Vector3& axis,double r)
27
Get distance between a point and a cylindical surface.
28
The function returns the _absolute_ distance, i.e. the result
33
double Cylinder::getDist(const Vector3& P) const
37
return fabs(m_r-(v1-d*m_axis).norm());
41
Get distance between a point and a cylindical surface.
42
The function returns the directed distance assuming an
43
inward facing surface normal, i.e. the result is positive
44
if the point is inside the cylinder and negative if it is
49
double Cylinder::getDirDist(const Vector3& P) const
53
return m_r-(v1-d*m_axis).norm();