Show / Hide Table of Contents

Method Rotate

Rotate(Geometry, Double, MapPoint)

Rotates the geometry by the specified angle of rotation around the provided origin point.

Declaration
public static Geometry Rotate(this Geometry geometry, double angle, MapPoint origin = null)
Parameters
Type Name Description
Geometry geometry

The geometry to rotate.

System.Double angle

The angle by which to rotate the geometry, counterclockwise, in degrees.

MapPoint origin

The center of rotation. If null, or IsEmpty is true, the center of the extent of the given geometry is used.

Returns
Type Description
Geometry

A new geometry constructed by rotating the input geometry by the specified angle of rotation around the provided origin point.

Remarks

The angle of rotation is used in the form of the modulo of 360 degrees; for example rotating by 540 degrees is equivalent to rotating the geometry by 180 degrees. A positive value corresponds to a counterclockwise rotation.

The GeometryType of the returned geometry is the same as the input geometry, except for an input Envelope which returns a Polygon result.

If the origin has a different SpatialReference to that of the geometry, the point will be reprojected before the geometry is rotated, using the default transformation.

Rotating a MapPoint using the same location for the origin parameter returns a MapPoint with the same values as the input.

Supports true curves.

See Also
Move(Geometry, System.Double, System.Double)
Scale(Geometry, System.Double, System.Double, MapPoint)
RotateSelectedElement(Double, MapPoint)

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0200.3 - 200.7
.NET200.3 - 200.7
.NET Windows200.3 - 200.7
.NET Android200.3 - 200.7
.NET iOS200.3 - 200.7
.NET Framework200.3 - 200.7
UWP200.3 - 200.7
In This Article
Back to top Copyright © 2022 Esri.