38 #include "ompl/util/GeometricEquations.h"
44 #include <boost/math/constants/constants.hpp>
47 #include "ompl/util/Exception.h"
51 return std::pow(std::sqrt(boost::math::constants::pi<double>()) * r,
static_cast<double>(N)) /
52 std::tgamma(
static_cast<double>(N) / 2.0 + 1.0);
58 return std::pow(std::sqrt(boost::math::constants::pi<double>()),
static_cast<double>(N)) /
59 std::tgamma(
static_cast<double>(N) / 2.0 + 1.0);
65 if (dTransverse < dFoci)
67 throw Exception(
"Transverse diameter cannot be less than the minimum transverse diameter.");
72 double conjugateDiameter;
77 conjugateDiameter = std::sqrt(dTransverse * dTransverse - dFoci * dFoci);
82 lmeas = dTransverse / 2.0;
83 for (
unsigned int i = 1u; i < N; ++i)
85 lmeas = lmeas * conjugateDiameter / 2.0;
double nBallMeasure(unsigned int N, double r)
The Lebesgue measure (i.e., "volume") of an n-dimensional ball of given radius.
double unitNBallMeasure(unsigned int N)
The Lebesgue measure (i.e., "volume") of an n-dimensional ball with a unit radius.
double prolateHyperspheroidMeasure(unsigned int N, double dFoci, double dTransverse)
The Lebesgue measure (i.e., "volume") of an n-dimensional prolate hyperspheroid (a symmetric hyperell...
The exception type for ompl.