gpt4 book ai didi

javascript Math.atan( Math.tan() ) 没用?

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:25:18 24 4
gpt4 key购买 nike

在 Windows 7 上,查看文件

c:\windows\winsxs...\weather.js

有一个函数computeSunRiseSunSet(Latitude, Longitude, TimeZone, Year, Month, Day)

他们没有引用算法的来源。

一行代码是

var C2=RD*(Math.atan(Math.tan(L0+C)) - Math.atan(.9175*Math.tan(L0+C))-C);

为什么会有 Math.atan( Math.tan( L0+C )) ?

是否与 ( L0+C ) 相同或存在边界情况?

最佳答案

atan(tan(x)) 是一个周期性的“锯齿”函数:

for -pi/2 < x < pi/2,   atan(tan(x)) = x
for pi/2 < x < 3pi/2, atan(tan(x)) = x - pi
for 3pi/2 < x < 5pi/2, atan(tan(x)) = x - 2pi
...

您可以 plot it and see other details about it在 Wolfram Alpha 上。

关于javascript Math.atan( Math.tan() ) 没用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18759554/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com