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

101
Views
Si un punto en lng y lat está en línea Segmento o está a solo 2 metros de distancia

Esto es lo que estoy tratando de lograr (por favor, no ponga duplicados si no puedo hacer preguntas), quiero saber si el punto cLng, cLat está en la línea Segmento aLng, alat a bLng, bLng. Mi problema es que mi control de distancia no funciona a 2.00 metros que es EPSILON. Cualquier ayuda para mejorar este código sería muy apreciada.

 var crossProduct = (cLat - aLat) * (bLng - aLng) - (cLng - aLng) * (bLat - aLat); if (Math.Abs(crossProduct) == 0) { return true; } var dotProduct = (cLng - aLng) * (bLng - aLng) + (cLat - aLat) * (bLat - aLat); var squaredLength = (bLng - aLng) * (bLng - aLng) + (bLat - aLat) * (bLat - aLat); var param = -1d; if (squaredLength != 0) //in case of 0 length line { param = dotProduct / squaredLength; } double xx = param < 0 ? aLng : param > 1 ? bLng: aLng + param * bLng - aLng; double yy = param < 0 ? aLat : param > 1 ? bLat: aLat + param * bLat - aLat; var dx = cLng - xx; var dy = cLat - yy; var sqrt = Math.Sqrt(dx * dx + dy * dy); return sqrt < EPSILON;
about 4 years ago · Juan Pablo Isaza
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!