SDDSlib
|
Provides functions for determining the relative position of points with respect to a polygonal contour, including whether a point lies inside it. More...
#include "mdb.h"
Go to the source code of this file.
Functions | |
double | pointIsLeftOfLine (int64_t i1, int64_t i2, double *x, double *y, double x0, double y0) |
int | pointIsInsideContour (double x0, double y0, double *x, double *y, int64_t n, double *center, double theta) |
Determine if a given point (x0, y0) is inside a specified polygonal contour. | |
Provides functions for determining the relative position of points with respect to a polygonal contour, including whether a point lies inside it.
Definition in file pointInsideContour.c.
int pointIsInsideContour | ( | double | x0, |
double | y0, | ||
double * | x, | ||
double * | y, | ||
int64_t | n, | ||
double * | center, | ||
double | theta ) |
Determine if a given point (x0, y0) is inside a specified polygonal contour.
This function uses the winding number method to check if the point (x0, y0) is inside the polygon defined by arrays x and y. If a rotation is specified (by a non-zero theta and a center), the point is rotated about the given center before the inside test is performed.
[in] | x0 | The x-coordinate of the point to test. |
[in] | y0 | The y-coordinate of the point to test. |
[in] | x | Array of x-coordinates of the polygon vertices. |
[in] | y | Array of y-coordinates of the polygon vertices. |
[in] | n | The number of vertices in the polygon. |
[in] | center | Pointer to an array representing the (x,y) center of rotation. |
[in] | theta | The clockwise rotation angle (in radians) to apply to the polygon. |
Definition at line 51 of file pointInsideContour.c.
double pointIsLeftOfLine | ( | int64_t | i1, |
int64_t | i2, | ||
double * | x, | ||
double * | y, | ||
double | x0, | ||
double | y0 ) |
Definition at line 19 of file pointInsideContour.c.