Lat – Long Converter ,Angle and Distance Calculator
This algorithm is used to convert the given latitude and longitude positions to XY co-ordinate system. This algorithm also finds the angle and distance between the any 2 positions and the angle between them. The distance matrix is formed by finding the distance of each customer from every other customer and is passed on to the nearest neighbor algorithm.
Pseudo Code
- Convert all the given co-ordinate positions into radians.
- Set r as the square root value of the sum of lat ,long values.
- Set the angle as the radian value of the rotation angle.
- If r is greater than 0
a) Set ct as the divided value of lat by r.
b) Set st as the divided value of long by r.
c) Set the X co-ordinate value as the product of the r value, the sum of the product of the ct with the cosine value of the angle with the sum of the product st with the Sin value of the angle.
d) Similarly find the Y co-ordinate value as the product of the r value, the sum of the product of st with the cosine value of the angle with the sum of the product ct with the Sin value of the angle.
e) Save the updated as the final X & Y value. - End if
- Call find_angle to find the angle between depo and the customer.
- Call Find_diatance to find the distance between the 2 loctions.
- Return X,Y,angle and distance.
I coudn't solve the 4th and 5th point.. could you help me to form an equation to solve it