34 #ifndef _GEOM_FUNCTION_
35 #define _GEOM_FUNCTION_
51 inline double cross_product(
double x1,
double y1,
double x2,
double y2,
double x3,
double y3 )
53 return ( x2 - x1 ) *( y3 - y1 ) - ( x3 - x1 ) *( y2 - y1 );
56 inline double dist_euc2d(
double x1,
double y1,
double x2,
double y2 )
58 return sqrt(( x2 - x1 ) *( x2 - x1 ) + ( y2 - y1 ) *( y2 - y1 ) );
61 inline double dist_euc2d_sq(
double x1,
double y1,
double x2,
double y2 )
63 return ( x2 - x1 ) *( x2 - x1 ) + ( y2 - y1 ) *( y2 - y1 );
66 bool isPointInPolygon(
int npol,
double *xp,
double *yp,
double x,
double y );
85 double x1,
double y1,
double x2,
double y2,
86 double& xRes,
double& yRes );
89 int convexHull(
int *
id,
const double*
const x,
const double*
const y,
int n );
92 int convexHullId(
int *
id,
const double*
const x,
const double*
const y,
int n,
int *&cHull );
95 double x3,
double y3,
double x4,
double y4 );
98 double x3,
double y3,
double x4,
double y4,
double xs2,
double ys2,
99 double *x,
double *y );
107 double x3,
double y3,
double x4,
double y4,
108 double *x,
double *y );
117 double x3,
double y3,
double x4,
double y4,
118 double *x,
double *y );
126 double x3,
double y3,
double x4,
double y4,
127 double *x,
double *y );
145 void toSVGPath(
int nbPoints,
int geomType,
146 double *x,
double *y,
147 int dpi,
double scale,