Jump to content

Archived

This topic is now archived and is closed to further replies.

n4gix

Sun Elevation (XML Script Recovered)

Recommended Posts

Due to the age of the original topic, along with several forum crashes over the years, I went back and recovered the XML script that was collaboratively developed back in 2003 for calculating the sun angle:

 

<String>
 %( (* zulutime+longitude/15 *)
 (P:ZULU TIME,hours) (A:PLANE LONGITUDE, degrees) 15 / +
 (* (7.3*sin((dayofyear-3)/365.25*360) *)
 (P:ZULU DAY OF YEAR,number) 3 - 365.25 / 2.0 pi * * sin 7.3 *
 (* -9.8*sin((dayofyear-80)/365.25*720)) *)
 (P:ZULU DAY OF YEAR,number) 80 - 365.25 / 4.0 pi * * sin -9.8 * + 60 / - (>L:local_sun_time,number)
 (* 23.5*sin((dayofyear-80)/365.25*360) *)
 (P:ZULU DAY OF YEAR,number) 80 - 365.25 / 2.0 pi * * sin  23.5 *
 (* (abs(lat)-90)*cos(localsuntime/24*360) *)
 (L:local_sun_time,number) 24.0 / 2.0 pi * * cos90
 (A:PLANE LATITUDE, degrees) abs - *(A:PLANE LATITUDE, degrees) 0 >
   if{ - }
   els{ + }
 (>L:local_sun_angle,number)(L:local_sun_angle,number))%!.4f!
</String>


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556

Interests: Gauge Programming - 3d Modeling for Milviz

Many Thanks to All That Donated To Our Server Drive!

Share this post


Link to post
Share on other sites

Another version, with time

 

(P:ZULU TIME,hours) (A:PLANE LONGITUDE,degrees) 15 / +
(P:ZULU DAY OF YEAR,number) 3 - 365.25 / 2.0 pi * * sin 7.3 *
(P:ZULU DAY OF YEAR,number) 80 - 365.25 / 4.0 pi * * sin -9.8 * + 60 / -
(>L:local_sun_time,number)

(P:ZULU DAY OF YEAR,number) 80 - 365.25 / 2.0 pi * * sin 23.45 * dgrd
(>L:declin,number)
(L:declin,number) sin (A:PLANE LATITUDE,radians) sin *
(L:declin,number) cos (A:PLANE LATITUDE,radians) cos *
(L:local_sun_time,number) 12 - 24.0 / 2.0 pi * * cos * + asin rddg 1.0
(A:PLANE ALTITUDE,km) 6370 / 1 + / acos rddg + int
(>L:local_sun_angle,number)


Jan

 

 

 

"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Thanks, Jan. Someone at FS Developer was asking about this yesterday, and I remembered this discussion and collaborative effort from so many years ago. It's fortunate that most of the thread remains more-or-less intact after several forum crashes, not to mention forum software changes!


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556

Interests: Gauge Programming - 3d Modeling for Milviz

Many Thanks to All That Donated To Our Server Drive!

Share this post


Link to post
Share on other sites

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
  • Donation Goals

    AVSIM's 2020 Fundraising Goal

    Donate to our annual general fundraising goal. This donation keeps our doors open and providing you service 24 x 7 x 365. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. We reset this goal every new year for the following year's goal.


    17%
    $4,475.00 of $25,000.00 Donate Now
×
×
  • Create New...