沿着已知距离的已知圆的圆周计算纬度和经度

时间:2011-01-24 14:00:54

标签: vb.net geospatial

我不需要编程语言的帮助,我需要某人的帮助来计算圆周上特定距离(即相距22英尺)的点的gps坐标。我知道起始gps坐标和半径。我很确定hasrsine,或余弦的球面定律有答案,但是我已经很长时间使用任何三角公式并且我无法弄清楚它。我正在使用十进制度,并在此vb.net中编程。如果有人能为我愚蠢,这将是一个很大的帮助。

3 个答案:

答案 0 :(得分:0)

据我所知,你有:

  1. 中心的协调中心     圆周上。
  2. 之间的距离     一个圆周上的两点     圈。
  3. 周长半径。
  4. 在我看来,这还不足以计算其他点的坐标。您应该至少有一个点坐标,因为我们只能猜测圆周上的点。

答案 1 :(得分:0)

这是基本算法:

Calculate the angular measure whose arc length is 22 feet, with the given radius
numPoints = Math.PI * 2 / angularMeasure
for i in range(numPoints):
    calculate proportion around the circle we are, in terms of degrees or radians
    calculate the location of the endpoint of a great circle or rhumb arc from the center point moving in the specific azimuth direction (from the proportion around the circle) the given radius

最后一点是最难的部分。这是来自WorldWind SDK的代码(可用:http://worldwind.arc.nasa.gov/java/)(注意 - 你必须根据角度计算半径,根据地球的半径/周长你可以很容易地做到这一点)

/*
Copyright (C) 2001, 2006 United States Government
as represented by the Administrator of the
National Aeronautics and Space Administration.
All Rights Reserved.
*/
/**
 * Computes the location on a rhumb line with the given starting location, rhumb azimuth, and arc distance along the
 * line.
 *
 * @param p            LatLon of the starting location
 * @param rhumbAzimuth rhumb azimuth angle (clockwise from North)
 * @param pathLength   arc distance to travel
 *
 * @return LatLon location on the rhumb line.
 */
public static LatLon rhumbEndPosition(LatLon p, Angle rhumbAzimuth, Angle pathLength)
{
    if (p == null)
    {
        String message = Logging.getMessage("nullValue.LatLonIsNull");
        Logging.logger().severe(message);
        throw new IllegalArgumentException(message);
    }
    if (rhumbAzimuth == null || pathLength == null)
    {
        String message = Logging.getMessage("nullValue.AngleIsNull");
        Logging.logger().severe(message);
        throw new IllegalArgumentException(message);
    }

    double lat1 = p.getLatitude().radians;
    double lon1 = p.getLongitude().radians;
    double azimuth = rhumbAzimuth.radians;
    double distance = pathLength.radians;

    if (distance == 0)
        return p;

    // Taken from http://www.movable-type.co.uk/scripts/latlong.html
    double lat2 = lat1 + distance * Math.cos(azimuth);
    double dPhi = Math.log(Math.tan(lat2 / 2.0 + Math.PI / 4.0) / Math.tan(lat1 / 2.0 + Math.PI / 4.0));
    double q = (lat2 - lat1) / dPhi;
    if (Double.isNaN(dPhi) || Double.isNaN(q) || Double.isInfinite(q))
    {
        q = Math.cos(lat1);
    }
    double dLon = distance * Math.sin(azimuth) / q;
    // Handle latitude passing over either pole.
    if (Math.abs(lat2) > Math.PI / 2.0)
    {
        lat2 = lat2 > 0 ? Math.PI - lat2 : -Math.PI - lat2;
    }
    double lon2 = (lon1 + dLon + Math.PI) % (2 * Math.PI) - Math.PI;

    if (Double.isNaN(lat2) || Double.isNaN(lon2))
        return p;

    return new LatLon(
        Angle.fromRadians(lat2).normalizedLatitude(),
        Angle.fromRadians(lon2).normalizedLongitude());
}

答案 2 :(得分:0)

您正在寻找所谓“小圈子”的等式。查看this book的小圆方程和该小圆的弧长方程。但是,由于距离太小,您可以将区域视为平坦并使用更简单的几何体。使用UTM坐标可以使计算比使用lat / long更简单。

Haversine公式涉及大圆圈,而不是小圆圈......