简体   繁体   English

数学方程转换

[英]Mathematical Equation Conversion

I'm attempting to write a method that determines the area of a polygon (complex or simple) on a sphere. 我正在尝试编写一种确定球体上多边形(复杂或简单)面积的方法。 I have a paper that was written by a few guys at the JPL that more or less give you the equations for these calculations. 我有一篇由JPL的几个人写的论文,或多或少地为您提供了这些计算的方程式。

The pdf file can be found here: pdf文件可以在这里找到:

http://trs-new.jpl.nasa.gov/dspace/handle/2014/40409 http://trs-new.jpl.nasa.gov/dspace/handle/2014/40409

The equation can be found on page 7, under "The Spherical Case - Approximation": 该方程式可以在第7页的“球形情况-近似”下找到:

I also typed the equation in Word: 我也在Word中键入了等式:

Spherical_Case_Equation Spherical_Case_Equation

在此处输入图片说明

I need assistance with converting this equation into the standard form (I think that's the right terminology). 在将该方程式转换为标准形式时,我需要帮助(我认为这是正确的术语)。 I've already done something similar for the Planer Case: 我已经为刨床做了类似的事情:

private double calcArea(Point2D[] shape) {
    int n = shape.length;
    double sum = 0.0;

    if (n < 3) return 0.0;

    for (int i = 0; i < n-1 ; i++) {
        sum += (shape[i].getX() * shape[i+1].getY()) - (shape[i+1].getX() * shape[i].getY());
    }

    System.out.println(0.5 * Math.abs(sum));
    return 0.5 * Math.abs(sum);
}

I just need help with doing something similar for the spherical case. 我只需要在球形情况下进行类似操作的帮助即可。 Any assistance will be greatly appreciated. 任何帮助将不胜感激。

I haven't read the paper you referenced. 我尚未阅读您引用的论文。 The area of a spherical polygon is proportional to the angle excess . 球形多边形的面积与角度超出成正比。

Area = r²(Σ Aᵢ - (n - 2)π) 面积=r²(ΣAᵢ-(n-2)π)

To compute the corner angles, you may start with the 3D coordinates of your points. 要计算转角,您可以从点的3D坐标开始。 So at corner i you have vertex p[i] = (x[i],y[i],z[i]) and adjacent vertices p[i-1] and p[i+1] (resp p[(i+n-1)%n] and p[(i+1)%n] to get this cyclically correct). 因此,在角i处,您有顶点p[i] = (x[i],y[i],z[i])和相邻的顶点p[i-1]p[i+1] (resp p[(i+n-1)%n]p[(i+1)%n]以获得正确的循环性)。 Then the cross products 然后交叉产品

v₁ = p[i] × p[i-1]
v₂ = p[i] × p[i+1]

will be orthogonal to the planes spanned by the incident edges and the origin which is the center of the sphere. 将与入射边缘和原点(即球的中心)所跨越的平面正交。 Noe the angle between two vectors in space is given by Noe空间中两个向量之间的夹角为

Aᵢ = arccos(⟨v₁,v₂⟩ / (‖v₁‖ * ‖v₂‖))

where ⟨v₁,v₂⟩ denotes the dot product between these two vectors which is proportional to the cosine of the angle, and ‖v₁‖ denotes the length of the first vector, likewise ‖v₂‖ for the second. 其中⟨v₁,v⟩表示两个矢量之间的点积 ,该积与角度的余弦成比例,而“v₁”表示第一个矢量的长度,第二个矢量也类似“ v2”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM