These scripts use trigonometry and the Pythagorean Theorem to find the distance to and direction of a certain point.
You can use these scripts in your own projects, just make sure to give credit to me (@GRE8T).