0

I have an elevation map of a mountainous area (large 2d array with z values)

I want to know the height of the apparent horizon angle for all compass bearings for certain points on my height map.

To illustrate, this website has some examples of what I want.

Edit: I've stopped trying to find a function that does this and am now writing my own.

My approach is drawing lines from my point radially, interpolating the height along those lines and then taking max(z/r) along each line.

If you know a function that already does this, please tell me, if not, hopefully I'll be able to upload one soon.

4

1 回答 1

2

假设您有 3 个矩阵,X Y并且Z您的 position (x,y,z),您可以计算

R = sqrt((X-x)**2 + (Y-y)**2)(TX丹尼尔...)

R = sqrt((X-x).^2 + (Y-y).^2)
Z = (Z-z)

即,与位置的距离和相对高度,因此

T = Z/R

是切线矩阵,是从位置到周围地形的视角的单调函数。

对于给定的方向,您可以使用Bresenham 算法的变体找到网格上最接近的点列表,并最终在点列表中找到最高T值。

最终,从不同方向的最大T(切线)值列表中,您可以计算出您所在位置的视角。

于 2015-04-17T18:14:41.900 回答