VPTissue Reference Manual
SimPT_Sim::Geom Class Reference

Provides geometric functions. More...

#include <Geom.h>

Collaboration diagram for SimPT_Sim::Geom:
Collaboration graph

Static Public Member Functions

static std::tuple< double, double, double > CircumCircle (double x1, double y1, double x2, double y2, double x3, double y3)
 Calculate circumcircle of triangle (x1,y1), (x2,y2), (x3,y3) More...
 
static std::array< double, 3 > Intersection (const std::array< double, 3 > &v1, const std::array< double, 3 > &v2, const std::array< double, 3 > &v3, const std::array< double, 3 > &v4)
 Intersection of two lines in x-y plane.s.
 
static int isLeft (const std::array< double, 3 > &P0, const std::array< double, 3 > &P1, const std::array< double, 3 > &P2)
 IsLeft tests if a point is Left|On|Right of an infinite line. More...
 
static int wn_PnPoly (const std::array< double, 3 > &p, const std::vector< Node * > &nodes)
 Calculates winding number to test whether a point is inside polygon (wn=0 iff p outside). More...
 

Detailed Description

Provides geometric functions.

Definition at line 49 of file Geom.h.

Member Function Documentation

tuple< double, double, double > SimPT_Sim::Geom::CircumCircle ( double  x1,
double  y1,
double  x2,
double  y2,
double  x3,
double  y3 
)
static

Calculate circumcircle of triangle (x1,y1), (x2,y2), (x3,y3)

Returns
values (xc, yc, r): coordinates of center and radius

Definition at line 35 of file Geom.cpp.

static int SimPT_Sim::Geom::isLeft ( const std::array< double, 3 > &  P0,
const std::array< double, 3 > &  P1,
const std::array< double, 3 > &  P2 
)
inlinestatic

IsLeft tests if a point is Left|On|Right of an infinite line.

See: http://geomalgorithms.com/a03-_inclusion.html

Returns
: >0, 0, <0 for P2 resp. left, on, right of line through P0 and P1

Definition at line 77 of file Geom.h.

static int SimPT_Sim::Geom::wn_PnPoly ( const std::array< double, 3 > &  p,
const std::vector< Node * > &  nodes 
)
inlinestatic

Calculates winding number to test whether a point is inside polygon (wn=0 iff p outside).

See: http://geomalgorithms.com/a03-_inclusion.html

Parameters
pThe point for which winding number is calculated
nodesVertex points of a polygon V[n+1] with V[n]=V[0]
Returns
the winding number (=0 only when p is outside)

Definition at line 90 of file Geom.h.

References SimPT_Sim::Container::make_const_circular(), and SimPT_Sim::Container::next().

Here is the call graph for this function:


The documentation for this class was generated from the following files: