Jump to content
aaryan

Maximum distance on a curve from point list

Recommended Posts

aaryan

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.

 

 

Thanks in advance

Aaryan

Share this post


Link to post
Share on other sites
Tharwat

maximum distance from which point ?

Share this post


Link to post
Share on other sites
aaryan

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 this post


Link to post
Share on other sites
Tharwat

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 >)

Share this post


Link to post
Share on other sites
aaryan

Thanks Both..

Share this post


Link to post
Share on other sites
Lee Mac

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×