Tariq
Tariq

Reputation: 57

How I can get the shortest distance from a line to an attractor in anylogic?

I want to get the shortest distance from a line to an attractor/point node in Anylogic. In all the available references, I found the function to calculate point to point distance. Is there any function/suggested way to calculate a line to point distance in Anylogic? (Please let me know if my question is not clear enough)

Upvotes: 1

Views: 218

Answers (1)

Benjamin
Benjamin

Reputation: 12803

Best use a Path element from the "Space Markup" library, not a Line.

This allows you to call getNearestPoint as below:

enter image description here

Upvotes: 1

Related Questions