X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgeometry.h;h=d657db6d986e5c454d66ec27c4ce921278070e7e;hb=dacd9dc2c1ac093e4945f7befaeb5ff1801a0f52;hp=2776ae34d4146e69e74be9647ed1144d0027a803;hpb=f507d97c1b1118834a70332f5f79d8479a6964c0;p=architektonas diff --git a/src/geometry.h b/src/geometry.h index 2776ae3..d657db6 100644 --- a/src/geometry.h +++ b/src/geometry.h @@ -1,27 +1,35 @@ #ifndef __GEOMETRY_H__ #define __GEOMETRY_H__ +#include "structs.h" #include "vector.h" -//class Circle; -//class Dimension; -//class Line; - class Geometry { public: // All methods are class methods for this class - static Point IntersectionOfLineAndLine(Point, Point, Point, Point); static double ParameterOfLineAndPoint(Point, Point, Point); + static double DistanceToLineFromPoint(Point, Point, Point); static Point MirrorPointAroundLine(Point, Point, Point); static Point RotatePointAroundPoint(Point, Point, double); static double Determinant(Point, Point); -// static int Intersects(Line *, Line *, double * tp = 0, double * up = 0); -// static int Intersects(Line *, Dimension *, double * tp = 0, double * up = 0); -// static int Intersects(Line * l, Circle * c, double * tp = 0, double * up = 0, double * vp = 0, double * wp = 0); -// static int Intersects(Circle * c1, Circle * c2, double * tp = 0, double * up = 0, double * vp = 0, double * wp = 0, Point * p1 = 0, Point * p2 = 0); + static void Intersects(Object *, Object *); + static void CheckLineToLineIntersection(Object *, Object *); + static void CheckCircleToCircleIntersection(Object *, Object *); + static void CheckLineToCircleIntersection(Object *, Object *); static void FindAnglesForSides(double s1, double s2, double s3, double * a1, double * a2, double * a3); + static Point GetPointForParameter(Object *, double); + static Point Midpoint(Line *); + static void FindTangents(Object *, Point); + static void FindTangents(Object *, Object *); + static Point NearestTo(Point, Point, Point); + static Vector GetNormalOfPointAndLine(Point, Line *); + static int Orientation(Point, Point, Point); + static Circle FindCircleForThreePoints(Point, Point, Point); + static Arc FindArcForThreePoints(Point, Point, Point); + static double Determinant3x3(double, double, double, double, double, double, double, double, double); + static Arc Unpack(Point, Point, double); + static double Pack(Arc *); }; #endif // __GEOMETRY_H__ -