【问题标题】:Formula translation for Mars calculator火星计算器的公式翻译
【发布时间】:2018-01-31 17:20:32
【问题描述】:

我需要把这个公式翻译成 Python:

δs = arcsin {0.42565 sin Ls)} + 0.25° sin Ls

记住 Ls 值为 122.985º(度数)

我使用的代码是:

Ls = 122.985
Ds = math.asin(math.radians(0.42565 * math.sin(math.radians(Ls)))) + 0.25 * math.sin(math.radians(Ls))

Ds 的结果大约是 0.2159º... 而它应该是大约 21,128º。

我做错了什么?

【问题讨论】:

标签: python calculator trigonometry sql-server-mars


【解决方案1】:

请注意,公式在第二项上有度数标记。意思是“取0.42565乘sine(Ls)的反正弦。那是一个角度,可以用度数来表示。在它上面加上0.25度乘sine(Ls)”。

angle1 = math.degrees(math.asin(0.42565 * math.sin(math.radians(Ls))))
correction = 0.25 * math.sin(math.radians(Ls)) # this is a value in degrees
Ds = angle1 + correction

或者合并成一个公式,为了清楚起见,我把它分解了

Ds = math.degrees(math.asin(0.42565 * math.sin(math.radians(Ls)))) + 0.25 * math.sin(math.radians(Ls))

以你的为例:

>>> Ls = 122.985
>>> angle1 = math.degrees(math.asin(0.42565 * math.sin(math.radians(Ls))))
>>> angle1
20.918572663722518
>>> correction = 0.25 * math.sin(math.radians(Ls))
>>> correction
0.20970328134223665
>>> angle1 + correction
21.128275945064754

不要过分强调我将第二个术语标记为更正,我从http://www.oregonl5.org/mist/docs/Mars24J/help/notes.html 的讨论中得到了这一点,特别是:

为了准确计算太阳照度相对于 一个局部平坦表面的平面,太阳赤纬可以是 修正了适合于所谓的小差异 扁球上纬度的行星测量,因为它在 Mars24 太阳钟。

但我可能会误解那句话的意思。我确定的主要事情是这些值经过测试,并且单位可以合理地执行。

【讨论】:

  • 这正是我想要的,谢谢彼得!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-05-24
  • 1970-01-01
  • 2014-05-22
  • 1970-01-01
相关资源
最近更新 更多