ConstructPointFromAngleDistance Method (IGeometryEngine)
Constructs a point at a specified angle from the horizontal axis and a specified distance away from the input point.
Parameters
- inputPoint
- The input point.
- angle
- The angle in radians measured counterclockwise from the horizontal axis.
- distance
-
The distance. Cannot be negative. If the distance is equal to zero, then the output point will have the same
xy-coordinates as the input point.
- spatialReference
- (Optional) The spatial reference of the output point. The default value is null.
Return Value
A point at the specified angle and distance.
Construct a Point at a distance and angle from an existing Point
MapPoint inPoint = MapPointBuilderEx.CreateMapPoint(3, 4);
double angle = 0;
double distance = 10;
MapPoint outPoint = GeometryEngine.Instance.ConstructPointFromAngleDistance(inPoint, angle, distance);
// outPoint.X = 13
// outPoint.Y = 4
SpatialReference sr = SpatialReferences.WGS84;
inPoint = MapPointBuilderEx.CreateMapPoint(0, 0, sr);
angle = Math.PI;
distance = 1;
outPoint = GeometryEngine.Instance.ConstructPointFromAngleDistance(inPoint, angle, distance, sr);
// outPoint.X = -1
// outPoint.Y = 0
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.