30 #ifndef __SPH_GEOM_2D_H__
31 #define __SPH_GEOM_2D_H__
36 #include <siscone/geom_2d.h>
39 #define M_PI 3.141592653589793238462643383279502884197
86 inline unsigned int get_theta_cell(
double theta){
87 return (
unsigned int) (1 << ((int) (32*((theta-theta_min)/(theta_max-theta_min)))));
91 inline unsigned int get_phi_cell(
double phi){
92 return (
unsigned int) (1 << ((int) (32*phi/
twopi+16)%32));
100 bool is_range_overlap(
const CSphtheta_phi_range &r1,
const CSphtheta_phi_range &r2);
107 const CSphtheta_phi_range range_union(
const CSphtheta_phi_range &r1,
const CSphtheta_phi_range &r2);
CSphtheta_phi_range()
default ctor
static double theta_max
maximal value for theta (set to pi)
const double twopi
definition of 2*M_PI which is useful a bit everyhere!
class for holding a covering range in eta-phi
static double theta_min
extremal value for theta
unsigned int theta_range
theta range as a binary coding of covered cells
unsigned int phi_range
phi range as a binary coding of covered cells
int add_particle(const double theta, const double phi)
add a particle to the range
CSphtheta_phi_range & operator=(const CSphtheta_phi_range &r)
assignment of range