calculating distance down target segment
finding final coordinates