this just gives you the distance of any two points on a plane, if you mean PATH distance, vs linear distance you would need to calculate that from your point to the path (calculating the nearest spot in the path to you is a pain in the ass) and then calculate this distance point to point in the path adding it up. if you need 3d distance you need to do the same for sqrt(z - z')^ 2
bear in mind that with linear distance you could be 100m from your objective but with a mountain in between.