﻿ QueryNormal(Multipart,SegmentExtensionType,Double,AsRatioOrLength,Double) Method—ArcGIS Pro
ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryEngine Class / QueryNormal Method / QueryNormal(Multipart,SegmentExtensionType,Double,AsRatioOrLength,Double) Method
The multipart to which the tangent line is constructed.
Specifies the extension method that determines the direction and position of the tangent line.
Specifies the distance along the segment from which the tangent line and normal line are constructed.
Determines whether the distanceAlongCurve is returned as a ratio of the segment length or as length from the start point.
Specifies the length of the returned normal line.
Example

In This Topic
QueryNormal(Multipart,SegmentExtensionType,Double,AsRatioOrLength,Double) Method
In This Topic
Constructs a line normal to a segment from a point at a specified distance along the segment.
Syntax
```public Polyline QueryNormal(
Multipart multipart,
SegmentExtensionType extensionType,
double distanceAlongCurve,
AsRatioOrLength asRatioOrLength,
double normalLength
)```
```Public Overloads Function QueryNormal( _
ByVal multipart As Multipart, _
ByVal extensionType As SegmentExtensionType, _
ByVal distanceAlongCurve As Double, _
ByVal asRatioOrLength As AsRatioOrLength, _
ByVal normalLength As Double _
) As Polyline```

#### Parameters

multipart
The multipart to which the tangent line is constructed.
extensionType
Specifies the extension method that determines the direction and position of the tangent line.
distanceAlongCurve
Specifies the distance along the segment from which the tangent line and normal line are constructed.
asRatioOrLength
Determines whether the distanceAlongCurve is returned as a ratio of the segment length or as length from the start point.
normalLength
Specifies the length of the returned normal line.

#### Return Value

Polyline representing the normal line.
Exceptions
ExceptionDescription
multipartis null or empty.
Spatial reference of multipartis an image coordinate system.
Remarks
A normal line at a point on a curve is perpendicular to the tangent line at that point. The distanceAlongCurve parameter can be negative, and it can be larger than the length of the segment. The extensionType parameter is ignored if distanceAlongCurve is greater than zero and less than the length of the segment. For example, shown below in blue is an elliptic arc segment with its start point in green and end point in red. The orange tangent line is constructed halfway along the curve and the extensionType parameter is ignored. The purple line is the normal line.

If distanceAlongCurve is less than zero, then the tangent line is embedded in an extension from the start point of the segment. If distanceAlongCurve is greater than the length of the input segment, then the tangent line is embedded in an extension from the end point of the segment. In the following example, distanceAlongCurve = 1.2, asRatioOrLength = AsRatioOrLength.AsRatio, and extensionType = SegmentExtensionType.ExtendTangentAtTo. Note that if asRatioOrLength = AsRatioOrLength.AsRatio, then the length of the input segment is 1. The extended tangent segment is the gray dashed line and is 0.2 * length of the input segment. The constructed tangent is in orange, and the normal line is in purple.

SegmentExtensionType.ExtendEmbeddedAtTo, SegmentExtensionType.ExtendEmbeddedAtFrom, and SegmentExtensionType.ExtendEmbedded when applied to an elliptic arc segment refer to the embedded ellipse or circle. Shown below in blue is an elliptic arc segment that is circular along with its embedded circle in gray.

Here is an example where distanceAlongCurve = 1.2, asRatioOrLength = AsRatioOrLength.AsRatio, and extensionType = SegmentExtensionType.ExtendEmbeddedAtTo.

If the input segment is not an elliptic arc segment, then SegmentExtensionType.ExtendEmbeddedAtTo, SegmentExtensionType.ExtendEmbeddedAtFrom, and SegmentExtensionType.ExtendEmbedded are equivalent to SegmentExtensionType.ExtendTangentAtTo, SegmentExtensionType.ExtendTangentAtFrom, and SegmentExtensionType.ExtendTangent respectively. There are cases when the tangent cannot be extended as specified by the extensionType parameter.For example, if the distanceAlongCurve is negative and extensionType = SegmentExtensionType.ExtendTangentAtTo.In this case, the tangent line is constructed at the start point of the input segment.Similarly, if the distanceAlongCurve is greater than the length of the input segment and extensionType = SegmentExtensionType.ExtendTangentAtFrom, then the tangent line is constructed at the end point of the input segment.

Example
QueryNormal
```string json = "{\"curvePaths\":[[[-13046586.8335,4036570.6796000004]," +
"{\"c\":[[-13046645.107099999,4037152.5873000026]," +
"[-13046132.776277589,4036932.1325614937]]}]],\"spatialReference\":{\"wkid\":3857}}";
Polyline polyline = PolylineBuilderEx.FromJson(json);

EllipticArcSegment arc = polyline.Parts[0][0] as EllipticArcSegment;

// No extension, distanceAlongCurve = 0.5

// use the polyline
Polyline poly_normal = GeometryEngine.Instance.QueryNormal(polyline, SegmentExtensionType.NoExtension, 0.5, AsRatioOrLength.AsRatio, 1000);
// or a segment
LineSegment seg_normal = GeometryEngine.Instance.QueryNormal(arc, SegmentExtensionType.NoExtension, 0.5, AsRatioOrLength.AsRatio, 1000);

// TangentAtFrom, distanceAlongCurve = -1.2
poly_normal = GeometryEngine.Instance.QueryNormal(polyline, SegmentExtensionType.ExtendTangentAtFrom, -1.2, AsRatioOrLength.AsRatio, 1000);
seg_normal = GeometryEngine.Instance.QueryNormal(arc, SegmentExtensionType.ExtendTangentAtFrom, -1.2, AsRatioOrLength.AsRatio, 1000);

// TangentAtTo (ignored because distanceAlongCurve < 0), distanceAlongCurve = -1.2
poly_normal = GeometryEngine.Instance.QueryNormal(polyline, SegmentExtensionType.ExtendTangentAtTo, -1.2, AsRatioOrLength.AsRatio, 1000);
seg_normal = GeometryEngine.Instance.QueryNormal(arc, SegmentExtensionType.ExtendTangentAtTo, -1.2, AsRatioOrLength.AsRatio, 1000);

// TangentAtTo, distanceAlongCurve = 1.2
poly_normal = GeometryEngine.Instance.QueryNormal(polyline, SegmentExtensionType.ExtendTangentAtTo, 1.2, AsRatioOrLength.AsRatio, 1000);
seg_normal = GeometryEngine.Instance.QueryNormal(arc, SegmentExtensionType.ExtendTangentAtTo, 1.2, AsRatioOrLength.AsRatio, 1000);

// TangentAtFrom (ignored because distanceAlongCurve > 0), distanceAlongCurve = 1.2
poly_normal = GeometryEngine.Instance.QueryNormal(polyline, SegmentExtensionType.ExtendTangentAtFrom, 1.2, AsRatioOrLength.AsRatio, 1000);
seg_normal = GeometryEngine.Instance.QueryNormal(arc, SegmentExtensionType.ExtendTangentAtFrom, 1.2, AsRatioOrLength.AsRatio, 1000);

// EmbeddedAtTo, distanceAlongCurve = 1.2
poly_normal = GeometryEngine.Instance.QueryNormal(polyline, SegmentExtensionType.ExtendEmbeddedAtTo, 1.2, AsRatioOrLength.AsRatio, 1000);
seg_normal = GeometryEngine.Instance.QueryNormal(arc, SegmentExtensionType.ExtendEmbeddedAtTo, 1.2, AsRatioOrLength.AsRatio, 1000);

// EmbeddedAtFrom, distanceAlongCurve = -0.2
poly_normal = GeometryEngine.Instance.QueryNormal(polyline, SegmentExtensionType.ExtendEmbeddedAtFrom, -0.2, AsRatioOrLength.AsRatio, 1000);
seg_normal = GeometryEngine.Instance.QueryNormal(arc, SegmentExtensionType.ExtendEmbeddedAtFrom, -0.2, AsRatioOrLength.AsRatio, 1000);```
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.