January 2020
Intermediate to advanced
470 pages
11h 13m
English
Let's start with a simple example. Suppose that we have some geographic data (as shown in the following snippet) related to some South American countries and the coordinates (latitude and longitude) of their capitals. Let's say that we want to calculate the average position of those cities. (No, I don't have a clue why we'd want to do that.) How would we go about it?
const markers = [ {name: "AR", lat: -34.6, lon: -58.4}, {name: "BO", lat: -16.5, lon: -68.1}, {name: "BR", lat: -15.8, lon: -47.9}, {name: "CL", lat: -33.4, lon: -70.7}, {name: "CO", lat: 4.6, lon: -74.0}, {name: "EC", lat: -0.3, lon: -78.6}, {name: "PE", lat: -12.0, lon: -77.0}, {name: "PY", lat: -25.2, lon: -57.5}, {name: "UY", lat: -34.9, lon: ...Read now
Unlock full access