Method Mirror
- Namespace
- GeometryHelper.Geometry
- Assembly
- GeometryHelper.dll
Mirror(GeoLine2)
Creates a reflection across the line carrying a segment.
public static GeoTransform2 Mirror(GeoLine2 line)
Parameters
lineGeoLine2The segment, read as the infinite line carrying it.
Returns
- GeoTransform2
The transformation that mirrors everything across that line.
Remarks
A reflection turns a shape round: a polygon that ran counter-clockwise comes back clockwise, and its signed area changes sign while its area does not.
A segment of any length carries its line: the segment from (0, 0) to (0.000007, 0.000007) mirrors (1, 0) to (0, 1), where it was read within the global vector tolerance of 1E-5 as having no direction and refused.
A line at 45 degrees swaps the two coordinates, and its matrix has whole numbers for entries: (0, 10) across the line y = x comes to (10, 0), where built from the unit direction (0.7071067811865476, 0.7071067811865476) it came to 9.999999999999998. The matrix is built from the direction divided by its greatest component, over its squared length.
Exceptions
- InvalidOperationException
Thrown when the segment has no length, its two ends one point.
- ArgumentException
Thrown when the segment has an end that is not a finite point.