Exemplo n.º 1
0
  /**
   * Calculate point along edge of hemisphere (using center point and current azimuth).
   *
   * <p>This is invoked for points that aren't visible in the current hemisphere.
   *
   * @param p Point2D
   * @return Point2D p
   */
  private Point2D edge_point(Point2D p, double current_azimuth) {
    double c = HEMISPHERE_EDGE;
    LatLonPoint tmpll =
        GreatCircle.sphericalBetween(centerY, centerX, c /*-epsilon*/, current_azimuth);
    double phi = tmpll.getRadLat();
    double lambda = tmpll.getRadLon();

    double kPrime = 1f / Math.cos(c);
    double cosPhi = Math.cos(phi);
    double sinPhi = Math.sin(phi);
    double lambdaMinusCtrLon = lambda - centerY;
    double cosLambdaMinusCtrLon = Math.cos(lambdaMinusCtrLon);
    double sinLambdaMinusCtrLon = Math.sin(lambdaMinusCtrLon);

    double x = (scaled_radius * kPrime * cosPhi * sinLambdaMinusCtrLon) + wx;
    double y =
        hy
            - (scaled_radius
                * kPrime
                * (cosCtrLat * sinPhi - sinCtrLat * cosPhi * cosLambdaMinusCtrLon));
    p.setLocation(x, y);
    return p;
  }