X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgeometry.cpp;h=41928aa629b7b253798ad19a1a0b73c3b56c19e5;hb=31dd33b097661175a86b6799df525972055099fb;hp=cfb051101c94498c1e026bacc7a2a58379d7f0ec;hpb=51de783e1c8d149c9dd9bd0999f2ad25dbe6edf2;p=architektonas diff --git a/src/geometry.cpp b/src/geometry.cpp index cfb0511..41928aa 100644 --- a/src/geometry.cpp +++ b/src/geometry.cpp @@ -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);