geom.h
Go to the documentation of this file.
1 #ifndef GEOMH
2 #define GEOMH
3 
4 #include "interval.h"
5 
35 boolean pointLeftOfLine(double px,double py,
36  double x1,double y1,double x2,double y2);
37 
55 boolean pointRightOfLine(double px,double py,
56  double x1,double y1,double x2,double y2);
57 
69 void ComputeBoundingBox(unsigned int n,double *x,double *y,
70  Tinterval *ix,Tinterval *iy);
71 
85 void ComputeBoundingBox3d(unsigned int n,double *x,double *y,double *z,
86  Tinterval *ix,Tinterval *iy,Tinterval *iz);
87 
111 void SegmentCircleIntersection(double r2,
112  double *x,double *y,
113  double tol,
114  unsigned int *n,
115  double *xi,double *yi);
116 
142 void SegmentSphereIntersection(double r2,
143  double *x,double *y,double *z,
144  double tol,
145  unsigned int *n,
146  double *xi,double *yi,double *zi);
147 
158 void Line2Points(double *x,double *y,boolean normalized,double *c);
159 
171 void Plane3Points(double *x,double *y,double *z,
172  boolean normalized,double *c);
173 
188 boolean RectangleCircleClipping(double r2,
189  Tinterval *x,Tinterval *y,
190  Tinterval *x_new,Tinterval *y_new);
191 
192 
209 boolean BoxSphereClipping(double r2,
210  Tinterval *x,Tinterval *y,Tinterval *z,
211  Tinterval *x_new,Tinterval *y_new,Tinterval *z_new);
212 
228 boolean RectangleParabolaClipping(Tinterval *x,double alpha,double beta,Tinterval *y,
229  Tinterval *x_new,Tinterval *y_new);
230 
248 boolean BoxSaddleClipping(Tinterval *x,Tinterval *y,double alpha,double beta,Tinterval *z,
249  Tinterval *x_new,Tinterval *y_new,Tinterval *z_new);
250 
261 void DefineNormalVector(double *v,double *n);
262 
272 void CrossProduct(double *v1,double *v2,double *v3);
273 
284 double DotProduct(double *v1,double *v2);
285 
299 boolean NeighbouringTriangles(unsigned int *v1,unsigned int *v2);
300 
313 boolean SameTriangle(unsigned int *v1,unsigned int *v2);
314 
326 double Det2x2(double *c1,double *c2);
327 
340 double Det3x3(double *c1,double *c2,double *c3);
341 
355 double BallVolume(unsigned int n,double r);
356 
367 void FirstCombination(unsigned int n,unsigned int m,unsigned int *cb);
368 
381 boolean NextCombination(unsigned int n,unsigned int m,unsigned int *cb);
382 
391 void PrintReal(FILE *f,double r);
392 
403 void Print3Reals(FILE *f,double r1,double r2,double r3);
404 
413 void PrintAngle(FILE *f,double r);
414 
415 #endif
boolean pointRightOfLine(double px, double py, double x1, double y1, double x2, double y2)
Determines if a point is at the right of a vector.
Definition: geom.c:34
double BallVolume(unsigned int n, double r)
Volume of of a n-ball.
Definition: geom.c:682
boolean RectangleCircleClipping(double r2, Tinterval *x, Tinterval *y, Tinterval *x_new, Tinterval *y_new)
Clips a rectangle and a circle.
Definition: geom.c:347
void SegmentCircleIntersection(double r2, double *x, double *y, double tol, unsigned int *n, double *xi, double *yi)
Intersects a segment and a circle.
Definition: geom.c:98
void PrintReal(FILE *f, double r)
Pretty print a real number.
Definition: geom.c:745
boolean NeighbouringTriangles(unsigned int *v1, unsigned int *v2)
Determines if two sets of vertices define a neighbouring triangle.
Definition: geom.c:657
void Plane3Points(double *x, double *y, double *z, boolean normalized, double *c)
Defines a plane given 3 points.
Definition: geom.c:313
void Print3Reals(FILE *f, double r1, double r2, double r3)
Pretty print three real number.
Definition: geom.c:763
void FirstCombination(unsigned int n, unsigned int m, unsigned int *cb)
Initializes a combination.
Definition: geom.c:706
boolean pointLeftOfLine(double px, double py, double x1, double y1, double x2, double y2)
Determines if a point is at the left of a vector.
Definition: geom.c:18
void PrintAngle(FILE *f, double r)
Pretty print an angle.
Definition: geom.c:773
double Det2x2(double *c1, double *c2)
Determinant of a 2x2 matrix.
Definition: geom.c:734
boolean BoxSaddleClipping(Tinterval *x, Tinterval *y, double alpha, double beta, Tinterval *z, Tinterval *x_new, Tinterval *y_new, Tinterval *z_new)
Clips a 3D box and a scaled saddle.
Definition: geom.c:518
double DotProduct(double *v1, double *v2)
Computes the dot product of two 3d vectors.
Definition: geom.c:652
boolean SameTriangle(unsigned int *v1, unsigned int *v2)
Identifies triangles formed by the same set of vertices.
Definition: geom.c:671
boolean BoxSphereClipping(double r2, Tinterval *x, Tinterval *y, Tinterval *z, Tinterval *x_new, Tinterval *y_new, Tinterval *z_new)
Clips a 3D box and a sphere.
Definition: geom.c:401
void CrossProduct(double *v1, double *v2, double *v3)
Computes the cross product of two 3d vectors.
Definition: geom.c:639
boolean RectangleParabolaClipping(Tinterval *x, double alpha, double beta, Tinterval *y, Tinterval *x_new, Tinterval *y_new)
Clips a 2D box and a scaled parabola.
Definition: geom.c:473
double Det3x3(double *c1, double *c2, double *c3)
Determinant of a 3x3 matrix.
Definition: geom.c:739
void ComputeBoundingBox3d(unsigned int n, double *x, double *y, double *z, Tinterval *ix, Tinterval *iy, Tinterval *iz)
Determines the axis aligned bounding box of a set of points in R^3.
Definition: geom.c:73
boolean NextCombination(unsigned int n, unsigned int m, unsigned int *cb)
Moves to the next combination.
Definition: geom.c:714
void Line2Points(double *x, double *y, boolean normalized, double *c)
Defines a line given two points.
Definition: geom.c:289
Defines a interval.
Definition: interval.h:33
void SegmentSphereIntersection(double r2, double *x, double *y, double *z, double tol, unsigned int *n, double *xi, double *yi, double *zi)
Intersects a segment and a sphere.
Definition: geom.c:185
void ComputeBoundingBox(unsigned int n, double *x, double *y, Tinterval *ix, Tinterval *iy)
Determines the axis aligned bounding box of a set of points in R^2.
Definition: geom.c:53
void DefineNormalVector(double *v, double *n)
Defines a unitary vector normal to a given vector.
Definition: geom.c:571
Definition of the Tinterval type and the associated functions.