在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 )一样还是有拐角处?
发布于 2013-09-12 08:52:26
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
...您可以在Wolfram上使用绘制它并查看有关它的其他细节。。
https://stackoverflow.com/questions/18759554
复制相似问题