Quiz Memorial Forum

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Функция расчета иллюминации луны
Ghost
post Feb 24 2011, 05:48 PM
Post #1


Посетитель
*

Group: Members
Posts: 1
Joined: 24-February 11
From: Ekaterinburg
Member No.: 324



CODE
proc adj360 { deg } {
for {} {1 > 0} {} {
if {$deg < 0 } {
set deg [ expr $deg + 360 ]
} else {
if { $deg > 360 } {
set deg [ expr $deg - 360 ]
} else {
return $deg
}}}
}

proc dtor { deg } {
return [ expr ($deg * 3.14159265358979323846 / 180) ]
}

set EPOCH_MINUS_1970 [ expr (20 * 365 + 5 - 1) ]

set tmpt [ clock scan now ]
set days [ expr ($tmpt - $EPOCH_MINUS_1970 * 86400) / 86400.0 ]
set N [ adj360 [ expr 360 * $days / 365.242191 ] ]
set Msol [ adj360 [ expr $N + 279.403303 - 282.768422 ] ]
set Ec [ expr 360 / 3.14159265358979323846 * 0.016713 * sin( [ dtor $Msol ] ) ]
set LambdaSol [ adj360 [ expr $N + $Ec + 279.403303 ] ]
set l [ adj360 [ expr 13.1763966 * $days + 318.351648 ] ]
set Mm [ adj360 [ expr $l - (0.1114041 * $days) - 36.340410 ] ]
set Nm [ adj360 [ expr 318.510107 - (0.0529539 * $days) ] ]
set Ev [ expr 1.2739 * sin( [ dtor [ expr 2*($l - $LambdaSol) - $Mm ] ] ) ]
set Ac [ expr 0.1858 * sin( [ dtor $Msol ] ) ]
set A3 [ expr 0.37 * sin( [ dtor $Msol ] ) ]
set Mmprime [ expr $Mm + $Ev - $Ac - $A3 ]
set Ec [ expr 6.2886 * sin( [ dtor $Mmprime ] ) ]
set A4 [ expr 0.214 * sin( [ dtor [ expr 2 * $Mmprime ] ] ) ]
set lprime [ expr $l + $Ev + $Ec - $Ac + $A4 ]
set V [ expr 0.6583 * sin( [ dtor [ expr 2 * ($lprime - $LambdaSol) ] ] ) ]
set ldprime [ expr $lprime + $V ]
set D [ expr $ldprime - $LambdaSol ]
set moon [ expr 50.0 * (1 - cos( [ dtor $D ])) ]

рабочий скрипт moon.rar


--------------------
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 23rd May 2018 - 07:22 PM
Design by GPF © 2006