

Var t:Number = ((p.x - l.sx) * dx + (p.y - l.sy) * dy) / (dx * dx + dy * dy) Reflection about the y-axis: None Compressing and stretching depends on the value of a a. Return new Point(2 * l.sx - p.x, 2 * l.sy - p.y) Reflection about the x-axis: None The graph is reflected about the y-axis when g(x) f (x) g ( x) f ( - x). Here it is in actionscript: public static function reflect(p:Point, l:Line):Point

I've found a formula which does this, but it seems as though it does not work with lines that look like they have equation y = x. Is there a simple way to calculate (x', y'), the reflection of point (x, y) in a line, where the line is described by the two points (x1, y1) and (x2, y2)? Edit:
Reflection across x 3 formula how to#
I have been looking at how to reflect a point in a line, and found this question which seems to do the trick, giving this formula to calculate the reflected point: TRgraph1 Vertical Reflection: Reflections are mirror images.
