Sun position

Discussion about RailWorks route design.

Re: Sun position

Unread postby fecrails » Sat Jan 10, 2015 9:51 am

It's important to remember that a C++ compiler (or any programming language for that matter) calculates trigonometric values in radians not degrees.
That's why the value will be between -1.5 to 1.5 which is equivalent to a value of -90 to 90 degrees of azimuth.

Why the confusion over whether the value should be negative or positive? The short answer is it all depends on whether the programmer used a north facing or south facing reference in their solar azimuth function. In this case experimentation seems to reveal they used a north facing reference, so values in the northern hemisphere will be negative. They also appear to reference the zenith as 0 radians and the horizon as 1.5 radians.

Using the numbers from my Chicago example above:

summerAzimuthAngle = (-90+71.6)π/180 = -.32

winterAzimuthAngle = (-90+24.7)π/180 = -1.14

**!!2cents!!**
User avatar
fecrails
 
Posts: 497
Joined: Tue Jun 26, 2012 9:13 am

Re: Sun position

Unread postby Bananarama » Sat Jan 10, 2015 2:47 pm

Ah, so.

!**conf**!

It's a wonder I got through High School at all. !**duh*!!
Cheers!
Marc - 3DTrains

Image
User avatar
Bananarama
 
Posts: 2749
Joined: Sat Feb 14, 2009 1:17 am
Location: Another Planet

Re: Sun position

Unread postby SAR704 » Tue Feb 03, 2015 6:31 am

Had another look at this today, and changed the default TimeOfDay folder in the RailSimulatorCore folder instead of the RailSimulator one.

For once, the sun is finally shining in the north where it should be (at least in the southern hemisphere)
Geforce GTX 1060
16GB RAM
Intel Core i5-3350 3.10ghz
Win te(n) Home
SAR704
 
Posts: 716
Joined: Tue Jun 21, 2011 9:48 am
Location: Adelaide, South Australia

Previous

Return to Route Design

Who is online

Users browsing this forum: No registered users and 64 guests