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

Featured Replies

Its hours and fractional minutes, just for testing.Arne Bartels

  • Replies 36
  • Views 4.6k
  • Created
  • Last Reply

Top Posters In This Topic

I have only one comment... Oh my god! Nice work, can't wait to try it out.

Karl,Genesis 1:16 : "God created 2!! lights".Some years later Arne gave us the code for the sun!May be he can do the same for the moon, so that we can do something useful with it?Jan"Procul Negotiis"

Jan

 

 

 

"Beatus ille qui procul negotiis..."

By the way, Karl even if the earth seems flat in FS, the lowering effect with height is modelled in FS. This time the simple trigonometry can't go wrong: with the aircraft height h and the earth radius R=6370km the apparent lowering of the horizon (or rising of the sun over horizon) is acos(1/(1+h/R)).So the formula goes into:%( (* 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) (* declination is the sun height over equator *)(P:ZULU DAY OF YEAR,number) 80 - 365.25 / 2.0 pi * * sin 23.45 * dgrd (>L:declin,number) (* sin(sunelev)=sin(decl)*sin(lat)+cos(decl)*cos(lat)*cos(localsuntime-12h) *)(* sin(decl)*sin(lat) *)(L:declin,number) sin (A:PLANE LATITUDE, radians) sin * (* cos(decl)*cos(lat) *)(L:declin,number) cos (A:PLANE LATITUDE, radians) cos * (* cos(localsuntime-12h) localsuntime-12h aka "hour angle" or "right ascension" of the sun *)(L:local_sun_time,number) 12 - 24.0 / 2.0 pi * * cos * + asin rddg(* curvature of the earth effect cos(lowered horizon)=1/(1+height/earth_radius) *)1.0 (A:PLANE ALTITUDE,km) 6370 / 1 + / acos rddg +(* apparent athmospheric refraction effect *)0.833 +(>L:local_sun_angle,number)(L:local_sun_time,number) d int )%!02d!:%( 1 % 60 * )%!.1f! %( (L:local_sun_angle,number) )%!.1f!Arne Bartels

Has anyone looked at the horizon at sunset at different altitudes?The horizon in Fs2002 acts really strange. I measured the touch of the sun's disk, the transit of the centre and the disappearance of the sun to the horizon. From 0ft to 500ft the horizon remains constant, from 500ft to 10000 ft it lowers slowly, at 10000ft it jumps up for about 0.5 degrees, above 10000ft it again lowers slowly. If measured over all altitudes I have the feeling that my altitude correction is pretty good, even if there are some strange jumps at 500ft and 10000ft. Two effects are independent from altitude: the blending effect of the sun (if enabled) disappears always at the same time of day, it corresponds with the transit of the sun's centre over the horizon at 0ft altitude. The sun disappears from view at about 3

Arne,You are a gem! Thanks for the revised formula that takes altitude into account. It works splendidly! I removed the .833 + "correction factor" as you've suggested.The piece de resistance for my implementation will be a small popup that will allow the pilot to adjust the on/off points manually, but otherwise the entire gauge will be invisible and transparent to the pilot.BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://mtco.com/~rsam/fartslogo.jpg

  • 2 years later...

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.