ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryEngine Class / ReflectAboutLine Method
The input geometry.
The reflection line.
Example

In This Topic
    ReflectAboutLine Method (GeometryEngine)
    In This Topic
    Reflects the input geometry about the given line.
    Syntax
    public Geometry ReflectAboutLine( 
       Geometry geometry,
       LineSegment reflectionLine
    )
    Public Function ReflectAboutLine( _
       ByVal geometry As Geometry, _
       ByVal reflectionLine As LineSegment _
    ) As Geometry

    Parameters

    geometry
    The input geometry.
    reflectionLine
    The reflection line.

    Return Value

    The reflected geometry.
    Exceptions
    ExceptionDescription
    The input geometry or the reflection line is null.
    The geometry is an envelope, and envelopes cannot be reflected.
    Incompatible spatial references.
    Remarks

    GeometryEngine ReflectAboutLine

    Example
    Reflect a polygon about a line
    SpatialReference sr = SpatialReferences.WGS84;
    
    Coordinate2D start = new Coordinate2D(0, 0);
    Coordinate2D end = new Coordinate2D(4, 4);
    LineSegment line = LineBuilderEx.CreateLineSegment(start, end, sr);
    
    Coordinate2D[] coords = new Coordinate2D[]
    {
      new Coordinate2D(-1, 2),
      new Coordinate2D(-1, 4),
      new Coordinate2D(1, 4),
      new Coordinate2D(-1, 2)
    };
    
    Polygon polygon = PolygonBuilderEx.CreatePolygon(coords, sr);
    
    // reflect a polygon about the line
    Polygon reflectedPolygon = GeometryEngine.Instance.ReflectAboutLine(polygon, line) as Polygon;
    
    // reflectedPolygon points are 
    //    (2, -1), (4, -1), (4, 1), (2, -1)
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also