Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
PointTriangle.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define vecdot(a, b)   ((a).x*(b).x + (a).y*(b).y + (a).z*(b).z)
 
#define vecdotproduct(a, b)
 
#define vecdiff(a, b)   ((coord){(a).x - (b).x, (a).y - (b).y, (a).z - (b).z})
 
#define vecdist2(a, b)   (sq((a).x - (b).x) + sq((a).y - (b).y) + sq((a).z - (b).z))
 

Functions

double PointTriangleDistance (const coord *P, const coord *P0, const coord *P1, const coord *P2, double *s, double *t)
 Returns the squared distance between point P and triangle P0, P1, P2.
 
int PointTriangleOrientation (const coord *P, const coord *P0, const coord *P1, const coord *P2)
 
double PointSegmentDistance (const coord *p, const coord *p0, const coord *p1, coord *segmentClosest, double *segmentParameter)
 Returns the squared distance between p and [p0:p1].
 
int PointSegmentOrientation (const coord *P, const coord *P0, const coord *P1)
 

Macro Definition Documentation

◆ vecdiff

#define vecdiff (   a,
  b 
)    ((coord){(a).x - (b).x, (a).y - (b).y, (a).z - (b).z})

Definition at line 7 of file PointTriangle.h.

◆ vecdist2

#define vecdist2 (   a,
  b 
)    (sq((a).x - (b).x) + sq((a).y - (b).y) + sq((a).z - (b).z))

Definition at line 8 of file PointTriangle.h.

◆ vecdot

#define vecdot (   a,
  b 
)    ((a).x*(b).x + (a).y*(b).y + (a).z*(b).z)

Definition at line 3 of file PointTriangle.h.

◆ vecdotproduct

#define vecdotproduct (   a,
  b 
)
Value:
((coord){(a).y*(b).z - (a).z*(b).y, \
(a).z*(b).x - (a).x*(b).z, \
(a).x*(b).y - (a).y*(b).x})
const vector a
Definition all-mach.h:59
int y
Definition common.h:76
int x
Definition common.h:76
int z
Definition common.h:76
size *double * b
Definition common.h:78

Definition at line 4 of file PointTriangle.h.

Function Documentation

◆ PointSegmentDistance()

double PointSegmentDistance ( const coord p,
const coord p0,
const coord p1,
coord segmentClosest,
double segmentParameter 
)

Returns the squared distance between p and [p0:p1].

Definition at line 263 of file PointTriangle.h.

References dimension, p, t, vecdiff, vecdot, and x.

Referenced by update_distance().

Here is the caller graph for this function:

◆ PointSegmentOrientation()

int PointSegmentOrientation ( const coord P,
const coord P0,
const coord P1 
)

Definition at line 308 of file PointTriangle.h.

References n, sign(), vecdiff, vecdotproduct, and x.

Referenced by update_distance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PointTriangleDistance()

double PointTriangleDistance ( const coord P,
const coord P0,
const coord P1,
const coord P2,
double s,
double t 
)

Returns the squared distance between point P and triangle P0, P1, P2.

Squared distance is returned in d2. s and t returns the closest point in parametric form in terms of edges P0P1 and P0P2.

Definition at line 15 of file PointTriangle.h.

References b1, c, HUGE, s, t, vecdiff, vecdot, and x.

Referenced by update_distance().

Here is the caller graph for this function:

◆ PointTriangleOrientation()

int PointTriangleOrientation ( const coord P,
const coord P0,
const coord P1,
const coord P2 
)

Definition at line 248 of file PointTriangle.h.

References n, sign(), vecdiff, vecdot, vecdotproduct, and x.

Referenced by update_distance().

Here is the call graph for this function:
Here is the caller graph for this function: