【发布时间】:2017-12-11 11:25:03
【问题描述】:
在计算日出/日落时如何考虑观察者海拔?
计算任何纬度/经度的日出/设置是没有问题的,但是如何计算海拔而不是海平面?我已经用完了可以尝试的组合,并且花了三天多的时间来寻求帮助
我正在使用 Paul Schlyter 的优秀公共领域 C 源代码,这似乎是最常见的。它确实允许您设置“太阳应该穿过的高度”,例如 -12 表示航海暮光或 -35/60 等,但我不确定如何修改它以考虑观察者海拔高度。
例如,厄瓜多尔的基多是海拔 2850 米的最高城市之一。
纬度+经度:-78.46784, -0.18065
时区:-5
海拔:2850m
使用 Casio 的计算器 (http://keisan.casio.com/exec/system/1224686065),这是我发现的少数可以解释海拔的计算器之一,它返回以下内容(日期=2017 年 1 月 1 日):
日出=6:14 日落=18:22 海拔=0m 我已经可以拿到了
日出=6:05 日落=18:30 海拔=2850m 但是我怎样才能得到这个?
我可以通过设置 Altitude=-35/60 (-0.58333) UpperLimb=1.0 获得第一个 (elev=0) 但是如何获得第二个?
我正在使用以下功能:
int sunriset( int year, int month, int day, double lon, double lat,
double altit, int upper_limb, double *trise, double *tset )
/*************************************************************/
/* altit = the altitude which the Sun should cross */
/* Set to -35/60 degrees for rise/set, -6 degrees */
/* for civil, -12 degrees for nautical and -18 */
/* degrees for astronomical twilight. */
/* upper_limb: non-zero -> upper limb, zero -> center */
/* Set to non-zero (e.g. 1) when computing rise/set */
/* times, and to zero when computing start/end of */
/* twilight. */
/**************************************************************/
SUNRISE.C(我已经制作了这个 READY-TO-RUN 示例): 使用硬编码的 Quito lat/long/etc:https://pastebin.com/XSWR2Hby 编译:gcc sunrise.c -o sun.exe
【问题讨论】:
-
this section的最后一段?
-
这就是我的想法,但我已经尝试了这些示例中的所有组合,例如。 alt = -0.8333 + -0.5536
alt = -0.8333 - -1.388
alt = -0.8333 + -101.378
alt = -0.8333 - (0.347 * Sqr(米))
等 -
他们的例子也令人困惑,因为显示的算法似乎同时使用除法和平方根?但他们的例子只使用了除法!?
-
问题似乎只与计算算法有关。没有语言问题。您可能会考虑删除 C 语言标签。
标签: equation calculation solar