Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Sun Elevation (XML Script Recovered)

Featured Replies

  • 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

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..."

  • 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.