49 Cquadtree(
double _x,
double _y,
double _half_size_x,
double _half_size_y);
67 int init(
double _x,
double _y,
double _half_size_x,
double _half_size_y);
base class for dynamic coordinates management
Implementation of a 2D quadtree.
double half_size_x
HALF size of the cell.
double half_size_y
HALF size of the cell.
Creference circle_intersect(double cx, double cy, double cR2)
circle intersection.
~Cquadtree()
default destructor at destruction, everything is destroyed except physical values at the leaves
int add(Cmomentum *v_add)
adding a particle to the tree.
int save(FILE *flux)
output a data file for drawing the grid.
double centre_x
x-position of the centre of the cell
int save_leaves(FILE *flux)
output a data file for drawing the tree leaves.
double centre_y
y-position of the centre of the cell
bool has_child
true if not a leaf
Cmomentum * v
physical contents
int init(double _x, double _y, double _half_size_x, double _half_size_y)
init the tree.
Cquadtree * children[2][2]
sub-cells ( 0,1->left-right; 0,1->bottom,top)
references used for checksums.