Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/support
esri/workers
Object: esri/geometry/mathUtils

require(["esri/geometry/mathUtils"], function(mathUtils) { /* code goes here */ });

Description

(Added at v3.8)
Utility methods for getting length of a line segment or intersection of two segments.

When coding legacy (non-AMD) style, there is no need to require the module. All methods and properties are available in the namespace. For example, esri.geometry.getLength().

Samples

Search for samples that use this class.

Methods

NameReturn typeSummary
getLength(point1, point2)NumberCalculates the length of a line based on the input of two points.
getLineIntersection(line1start, line1end, line2start, line2end)PointCalculates the intersecting point of two lines.
Method Details

getLength(point1, point2)

Calculates the length of a line based on the input of two points.
Return type: Number
Parameters:
<Point> point1 Required The beginning point.
<Point> point2 Required The ending point.

getLineIntersection(line1start, line1end, line2start, line2end)

Calculates the intersecting point of two lines. If the lines are parallel, a null value is returned.
Return type: Point
Parameters:
<Point> line1start Required The beginning point of the first line.
<Point> line1end Required The ending point of the first line.
<Point> line2start Required The beginning point of the second line.
<Point> line2end Required The ending point of the second line.
Show Modal