In the image above I have mapped the separation positions inside the warehouse where I work. I need to calculate the distance that the person who is separating goes through the warehouse. For example if the person is separating in position 1AF-001-10 and moves to position 1AD-013-10 if I calculate only X and Y it will calculate in a straight line but it will be wrong I need it to go through the points of intersection is the problem. I do not know how I'm going to make him understand what points he needs to take to figure out the right route when he leaves the streets he's been ferrying. I put the intersection points that would be these connections ... and the right one I just can not reason as I do for him to understand what points he needs to get. For example in this case at the top it should calculate as follows:
De Para
1AF-001-10 || 1AD-013-10 = soma(valor1,valor2,valor3)
That is:
De Para
1AF-001-10 || interseçãoE = valor1
De Para
interseçãoE || interseçãoD = valor2
De Para
interseçãoD || 1AD-013-10 = valor3