43DelaunayTriangle :: DelaunayTriangle(
Domain *d,
int node1,
int node2,
int node3) :
57DelaunayTriangle :: ~DelaunayTriangle()
62DelaunayTriangle :: setCircumCircle(
double x,
double y,
double r)
70DelaunayTriangle :: giveDistanceToCenter(
const FloatArray &coords)
72 double x = coords.
at(1);
73 double y = coords.
at(2);
78 return ( sqrt( ( xC - x ) * ( xC - x ) + ( yC - y ) * ( yC - y ) ) );
82DelaunayTriangle :: computeCircumcircle()
103 a = x1 * y2 + y1 * x3 + x2 * y3 - 1.0 * ( x1 * y3 + y1 * x2 + y2 * x3 );
104 bx = -1.0 * ( ( ( x1 * x1 + y1 * y1 ) * y2 + y1 * ( x3 * x3 + y3 * y3 ) + ( x2 * x2 + y2 * y2 ) * y3 )
105 - 1.0 * ( ( x1 * x1 + y1 * y1 ) * y3 + y1 * ( x2 * x2 + y2 * y2 ) + y2 * ( x3 * x3 + y3 * y3 ) ) );
106 by = ( ( ( x1 * x1 + y1 * y1 ) * x2 + x1 * ( x3 * x3 + y3 * y3 ) + ( x2 * x2 + y2 * y2 ) * x3 )
107 - 1.0 * ( ( x1 * x1 + y1 * y1 ) * x3 + x1 * ( x2 * x2 + y2 * y2 ) + x2 * ( x3 * x3 + y3 * y3 ) ) );
108 c = ( ( ( x1 * x1 + y1 * y1 ) * x2 * y3 + x1 * y2 * ( x3 * x3 + y3 * y3 ) + y1 * ( x2 * x2 + y2 * y2 ) * x3 )
109 - 1.0 * ( ( x1 * x1 + y1 * y1 ) * y2 * x3 + x1 * ( x2 * x2 + y2 * y2 ) * y3 + y1 * x2 * ( x3 * x3 + y3 * y3 ) ) );
111 double xCenterCoordinate = ( -1.0 * bx / ( 2 * a ) );
112 double yCenterCoordinate = ( -1.0 * by / ( 2 * a ) );
113 double absA = a < 0 ? -1.0 * a : a;
115 double radius = ( ( sqrt(bx * bx + by * by + 4.0 * a * c) ) / ( 2.0 * absA ) );
120std :: list< LocalInsertionData< DelaunayTriangle * > > *
121DelaunayTriangle :: giveListOfCellsAndPosition()
127DelaunayTriangle :: giveShortestEdgeLength()
132 return min( length1,
min(length2, length3) );
136DelaunayTriangle :: giveEdgeLength(
int nodeA,
int nodeB)
IntArray nodes
Nodes defining the triangle.
FloatArray circumCircle
Parameters of the circumscribed circle: coordinates of center (x,y) and its radius.
double giveYCenterCoordinate() const
Gives the y coordinate of the center of the circumscribed circle.
Domain * domain
Domain where the nodes are defined.
void setCircumCircle(double x, double y, double r)
Sets up the parameters of the calculated circumscribed circle.
double giveEdgeLength(int nodeA, int nodeB)
Gives the length of the edge between two nodes.
std ::list< LocalInsertionData< DelaunayTriangle * > > listOfCellsContainedInAndPosition
In order to allow fast search in octree, every triangle stores list of octree cells where its circums...
double giveXCenterCoordinate() const
Gives the x coordinate of the center of the circumscribed circle.
bool validFlag
Flag for Delaunay property.
int giveNode(int i)
Gives the i-node of the triangle.
void computeCircumcircle()
Calculates the parameters of the circumscribed circle.
double giveCoordinate(int i) const
const FloatArray & giveCoordinates() const
FloatArrayF< N > min(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
double distance(const FloatArray &x, const FloatArray &y)