distance

fun distance(geometry1: Geometry, geometry2: Geometry): Double

Measures the simple planar distance between two geometries. Planar measurements of distance and area can be extremely inaccurate if using an unsuitable spatial reference. Ensure that you understand the potential for error with the geometry's spatial reference. If you need to calculate more accurate results consider using a different spatial reference, or using the geodetic equivalent, GeometryEngine.distanceGeodetic(Point, Point, LinearUnit, AngularUnit, GeodeticCurveType). See [https://developers.arcgis.com/documentation/spatial-references/] for more information about spatial references.

Return

The distance between the two geometries in the same units as the geometry's spatial reference system.