18 namespace JGEOMETRY2D {}
19 namespace JPP {
using namespace JGEOMETRY2D; }
21 namespace JGEOMETRY2D {
44 for (const_iterator i = this->begin(); i != this->end(); ++i) {
46 const double x = dir.
getDot(*i);
50 index = std::distance(this->begin(), i);
118 double phi_min = 0.0;
119 double phi_max = phiMax;
121 if (phi_max < 0.0) phi_max = 0.0;
122 if (phi_max >
PI) phi_max =
PI;
124 if (phi_max > phi_min) {
126 const double rad = phi_max - phi_min;
127 const double bin = rad / floor(rad/grid + 0.5);
129 for (
double phi = phi_min; phi < phi_max + 0.5*bin; phi += bin) {
133 }
else if (
PI - phi < 0.5*bin) {
136 push_back(dir + phi);
137 push_back(dir - phi);
Data structure for angle in two dimensions.
Direction set covering (part of) solid angle.
JOmega2D()
Default constructor.
int find(const JAngle2D &dir) const
Get index of direction closest to given direction.
double getDot(const JAngle2D &angle) const
Get dot product.
Base class for direction set.
void configure(const JAngle2D &dir, const double phiMax, const double grid)
Configure direction set.
JOmega2D(const JAngle2D &dir, const double phiMax, const double grid)
Constructor.
JOmega2D(const double grid)
Constructor.