In the image below, you can see that there 3 lines drawn from one point (the black circle) to its 3 related points ().
IMAGE
QUESTION
How to calculate latitude and longitude point between points along each line, using a percentage of the distance between the two points?
For example, if I wanted to get the position to be able to draw additional circles along each line with a 20% difference?
WHAT CODE I HAVE NOW
var data = [
{ "coords" : [ 53.409045, -2.985406 ]},
{ "coords" : [ 53.408747, -2.982862 ]},
{ "coords" : [ 53.407630, -2.984136 ]},
{ "coords" : [ 53.407142, -2.986931 ]}
];
var pointA = new L.LatLng(53.409045, -2.985406);
var pointB;
data.forEach(function(d) {
pointB = new L.LatLng(d.coords[0], d.coords[1]);
L.polyline([pointA, pointB]).addTo(map);
L.circle([d.coords[0], d.coords[1]], 10).addTo(map);
});
The only things the code above is doing is drawing a circle for each point and a line from the main circle (pointA) to the other circles (pointB)
I pretty much need to know how to calculate multiple coordinates, by percentage of distance, between the pointA and and its related points.
I need to make sure all green circle are the same distance from the center circle
CODEPEN TO TEST WITH
EDIT - IMAGES OF WHAT i HAVE SO FAR USING THE CORRECT ANSWER BELOW