Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

218
Views
What's the best approach to take the coordinates from each object (x,y) and calculate the distance between them?
const destinations = [
{
    id: 0,
    city: "Buenos Aires",
    country: "Argentina",
    codeIATA: "AEP",
    aeroName: "Aeroparque Jorge Newbery",
    coordX: 15,
    coordY: 36,
},
{
    id: 1,
    city: "El Calafate",
    country: "Argentina",
    codeIATA: "FTE",
    aeroName: "Comandante A. Tola",
    coordX: -49,
    coordY: -63,
},

With an array of several objects that constitute cities/airports like the 2 objects above, the user will have to select one object as origin and the other as destination. What I'm trying to find out is how to catch the x and y coordinates of each chosen origin and destination to calculate the distance between the two points and be able to provide distance in km, time and flight cost.

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!