# Maximum distance on a curve from point list

## Recommended Posts

Dear All,

I have a list of points which lies on the curve, is there a way to find which point has maximum distance on a curve. If so please give me a solution.

Aaryan

##### Share on other sites

maximum distance from which point ?

##### Share on other sites

Thanks Tharwat

Maximum distance along curve from starting point of curve.

suppose i have 3 points in a list which lies exactly on curve object, one point is at 100m and second is at 101.235m and third may be at 94.222m. Like this second point has maximum distance. Any guess

##### Share on other sites

This function is to give you the far most distance from a given point .

```(defun foo (l p / d dis mx)
(setq d 0.)
(foreach pt l
(if (> (setq dis (distance p pt)) d)
(setq mx pt
d  dis
)
)
)
mx
)

```

```(foo <list of points> <any point >)
```

Thanks Both..

##### Share on other sites

For the straight line distance, use the distance function; for the distance along the curve, use the vlax-curve-getdistatpoint function.