示例#1
0
文件: geometry.hpp 项目: nttputus/PCL
template<class Real> Point3D<Real>
RandomBallPoint (void)
{
  Point3D < Real > p;
  while (1)
  {
    p.coords[0] = Real (1.0 - 2.0 * Random<Real> ());
    p.coords[1] = Real (1.0 - 2.0 * Random<Real> ());
    p.coords[2] = Real (1.0 - 2.0 * Random<Real> ());
    double l = SquareLength (p);
    if (l <= 1)
    {
      return p;
    }
  }
}
示例#2
0
float Vector3f::Length()
{
  return std::sqrt(SquareLength());
}
示例#3
0
文件: geometry.hpp 项目: nttputus/PCL
template<class Real> double
Length (const Point3D<Real>& p)
{
  return sqrt (SquareLength (p));
}