Geometry Expressions

Distance From a Point to a Segment

We generate code to find the distance between a given point and a line segment.

First draw the segment and the point, and specify coordinates.

Picture 1

Then measure the distance between the point and the segment, and name it.

Picture 2

Copy as JavaScript.

Picture 3

And paste into a code editor.

Picture 4