From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Xojo.Core.Point.DistanceTo(Other As Xojo.Core.Point) As Double

Supported for all project types and targets.

Returns a double that measures the distance between the two points.

Sample Code

Calculate the distance (length of the line) between two points:

Var p1 As New Xojo.Core.Point(10, 20)
Var p2 As New Xojo.Core.Point(200, 5)
Var dist As Double = p1.DistanceTo(p2)