]> Shamusworld >> Repos - architektonas/blobdiff - src/geometry.cpp
Fixed incorrect rotation in Arc object.
[architektonas] / src / geometry.cpp
index cfb051101c94498c1e026bacc7a2a58379d7f0ec..058dbfa14c06895ce659db9310ad778e57f7c925 100644 (file)
@@ -62,15 +62,15 @@ double Geometry::ParameterOfLineAndPoint(Point tail, Point head, Point point)
 }
 
 
-Point Geometry::MirrorPointAroundLine(Point point, Point p1, Point p2)
+Point Geometry::MirrorPointAroundLine(Point point, Point tail, Point head)
 {
        // Get the vector of the intersection of the line and the normal on the
        // line to the point in question.
-       double t = ParameterOfLineAndPoint(p1, p2, point);
-       Vector v = Vector(p1, p2) * t;
+       double t = ParameterOfLineAndPoint(tail, head, point);
+       Vector v = Vector(tail, head) * t;
 
-       // Get the point normal to point to the line passed in (p2 is the tail)
-       Point normalOnLine = p2 + v;
+       // Get the point normal to point to the line passed in
+       Point normalOnLine = tail + v;
 
        // Make our mirrored vector (head - tail)
        Vector mirror = -(point - normalOnLine);
@@ -85,6 +85,7 @@ Point Geometry::MirrorPointAroundLine(Point point, Point p1, Point p2)
 Point Geometry::RotatePointAroundPoint(Point point, Point rotationPoint, double angle)
 {
        Vector v = Vector(point, rotationPoint);
+//     Vector v = Vector(rotationPoint, point);
        double px = (v.x * cos(angle)) - (v.y * sin(angle));
        double py = (v.x * sin(angle)) + (v.y * cos(angle));