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.

Animation: drawing a segment and a point and setting their coordinates

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

Animation: measuring and naming the distance from the point to the segment

Copy as JavaScript.

Animation: copying the distance as JavaScript

And paste into a code editor.

Animation: pasting the JavaScript function into a code editor