35 #include "CryptProjectionStatistics.hpp"
36 #include "RandomNumberGenerator.hpp"
42 bool CellsRadiusComparison(
const std::pair<CellPtr, double> lhs,
const std::pair<CellPtr, double> rhs)
44 return lhs.second < rhs.second;
55 c_vector<double,2> line_position;
56 line_position[0] = norm_2(rCellPosition)*cos(angle);
57 line_position[1] = norm_2(rCellPosition)*sin(angle);
59 double distance_between_cell_and_line = norm_2(rCellPosition - line_position);
61 return (distance_between_cell_and_line <= widthOfSection);
71 assert(angle>=-M_PI && angle<=M_PI);
73 std::list<std::pair<CellPtr, double> > cells_list;
85 cells_list.push_back(pair);
90 cells_list.sort(CellsRadiusComparison);
93 std::vector<CellPtr> ordered_cells;
94 for (std::list<std::pair<CellPtr, double> >::iterator iter = cells_list.begin();
95 iter != cells_list.end();
98 ordered_cells.push_back(iter->first);
101 return ordered_cells;
bool CellIsInSection(double angle, const c_vector< double, 2 > &rCellPosition, double widthOfSection=0.6)
MeshBasedCellPopulation< 2 > & mrCrypt
static RandomNumberGenerator * Instance()
std::vector< CellPtr > GetCryptSection(double angle=DBL_MAX)
CryptProjectionStatistics(MeshBasedCellPopulation< 2 > &rCrypt)
c_vector< double, SPACE_DIM > GetLocationOfCellCentre(CellPtr pCell)