August 10, 201213 yr Moderator 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 Avsim Board of Directors | Avsim Forums Moderator
August 10, 201213 yr 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..."
August 11, 201213 yr Author Moderator 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 Avsim Board of Directors | Avsim Forums Moderator
Create an account or sign in to comment