- #1
Rich2020
- 4
- 0
Hi guys & girls, I'm using Google maps coordinates to draw a line and want to divide the line by its length, giving segments where the length of each segment is equal to 1.
EG:
P1
p1.lat = 54.97435323116719
p1.lng = 54.9742647135445
P2
p2.lat = -1.6116368025541306
p2.lng = -1.6115100681781769
let's assume that the unit of measure is meter.
Now, between the points p1 and p2, I need to calculate the (x,y) every 1 meter - along the length of the line.
My attempt results in:
x = -0.000006809047899462957, y = 0.00000974879815028264
but I'm not sure if that is correct.
I use the formula:
x = (x2-x1) / distance
y = (xy-xy) / distance
Is this correct? If not, how can I do this?
EG:
P1
p1.lat = 54.97435323116719
p1.lng = 54.9742647135445
P2
p2.lat = -1.6116368025541306
p2.lng = -1.6115100681781769
let's assume that the unit of measure is meter.
Now, between the points p1 and p2, I need to calculate the (x,y) every 1 meter - along the length of the line.
My attempt results in:
x = -0.000006809047899462957, y = 0.00000974879815028264
but I'm not sure if that is correct.
I use the formula:
x = (x2-x1) / distance
y = (xy-xy) / distance
Is this correct? If not, how can I do this?