Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

219
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda