Go to the documentation of this file.
23 #ifndef O2SCL_PINSIDE_H
24 #define O2SCL_PINSIDE_H
30 #include <boost/numeric/ublas/vector.hpp>
32 #include <o2scl/test_mgr.h>
33 #include <o2scl/vector.h>
35 #ifndef DOXYGEN_NO_O2NS
107 double x3,
double y3,
double x4,
double y4) {
137 template<
class vec_t>
138 int inside(
double x,
double y,
size_t n,
const vec_t &xa,
157 for(
size_t i=0;i<n;i++) {
163 for(
size_t i=0;i<n;i++) {
164 if (yb[i]==ymin && xb[i]<xmin) {
169 vector_rotate<vec_t,double>(n,xb,ix);
170 vector_rotate<vec_t,double>(n,yb,ix);
173 for(
size_t i=0;i<n;i++) {
189 #ifndef DOXYGEN_NO_O2NS
Test line intersection and point inside polygon.
The main O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$scl names...
static const double x4[22]
Internal line definition for pinside.
void vector_copy(const vec_t &src, vec2_t &dest)
Simple vector copy.
int intersect(line P, line Q)
Test if line segments P and Q intersect.
static const double x2[5]
Internal point definition for pinside.
int inside(point t, point p[], int N)
Test if point t is inside polygon p of size N.
static const double x1[5]
A class to manage testing and record success and failure.
int intersect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
Determine if two line segments intersect.
int inside(double x, double y, size_t n, const vec_t &xa, const vec_t &ya)
Determine if point (x,y) is inside a polygon.
int test(test_mgr &t)
Perform some simple testing.
static const double x3[11]
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).