Last change
on this file since 3376 was
2696,
checked in by kanani, 7 years ago
|
Merge of branch palm4u into trunk
|
File size:
433 bytes
|
Line | |
---|
1 | function Update_SUN( ) |
---|
2 | |
---|
3 | global TIME SUN |
---|
4 | |
---|
5 | SunRise = 4.5; |
---|
6 | SunSet = 19.5; |
---|
7 | Thour = TIME/3600.; |
---|
8 | Tlocal = Thour - floor(Thour/24)*24; |
---|
9 | |
---|
10 | if ( (Tlocal>=SunRise) & (Tlocal<=SunSet) ) |
---|
11 | Ttmp = (2.0*Tlocal-SunRise-SunSet)/(SunSet-SunRise); |
---|
12 | if (Ttmp>0) |
---|
13 | Ttmp = Ttmp*Ttmp; |
---|
14 | else |
---|
15 | Ttmp = -Ttmp*Ttmp; |
---|
16 | end |
---|
17 | SUN = ( 1.0 + cos(pi*Ttmp) )/2.0 ; |
---|
18 | else |
---|
19 | SUN = 0.0; |
---|
20 | end |
---|
21 | |
---|
22 | return % Update_SUN |
---|
23 | |
---|
Note: See
TracBrowser
for help on using the repository browser.