Пример #1
0
  /**
   * Determines whether two lon distances overlap
   *
   * @param lonmStart
   * @param lonmEnd
   * @param lonmMin
   * @param lonmMax
   * @return
   */
  public static boolean isLonmOverlaps(int lonmStart, int lonmEnd, int lonmStart2, int lonmEnd2) {
    lonmEnd = Util.makeContinuousFromStartLonm(lonmStart, lonmEnd);
    lonmStart2 = Util.makeContinuousLonm(lonmStart, lonmStart2);
    lonmEnd2 = Util.makeContinuousFromStartLonm(lonmStart2, lonmEnd2);

    return lonmStart2 <= lonmEnd && lonmEnd2 > lonmStart;
  }
Пример #2
0
  public static double getDistSquared(double lonm1, double latm1, double lonm2, double latm2) {
    lonm2 = Util.makeContinuousLonm(lonm1, lonm2) - lonm1;
    latm2 = latm2 - latm1;

    return lonm2 * lonm2 + latm2 * latm2;
  }
Пример #3
0
  public static double getDist(double lonm1, double latm1, double lonm2, double latm2) {
    lonm2 = Util.makeContinuousLonm(lonm1, lonm2) - lonm1;
    latm2 = latm2 - latm1;

    return Math.sqrt(lonm2 * lonm2 + latm2 * latm2);
  }
Пример #4
0
  public static int getLonmMax(int l1, int l2) {
    int al1 = Util.makeContinuousLonm(l2, l1);

    return normalizeLonm(Math.max(al1, l2));
  }