point-to surface direction calculation done. Bug fixed and verified with results. next step: implement the third distance caclulation function