Understanding the Sun’s Trajectory Throughout the Year

As someone interested in optimizing solar energy usage, I find it crucial to understand the path the sun takes through the sky over the course of a year. This knowledge helps me make informed decisions about the positioning of solar panels, shading considerations, and energy forecasts.

Throughout the year, the sun’s trajectory shifts due to the tilt of the Earth’s axis. Around the summer solstice (around June 21st in the Northern Hemisphere), the sun rises in the northeast and sets in the northwest. Its arc across the sky is high, providing the longest daylight hours and the most direct sunlight. This is the time when solar panels tend to generate the most energy, particularly if they are optimally angled.

Conversely, during the winter solstice (around December 21st), the sun rises in the southeast and sets in the southwest. Its arc is much lower in the sky, and the days are shorter. For me, this means that energy production can be significantly reduced due to both the lower solar elevation and the potential for obstructions like trees or buildings to block the sun’s rays.

Between these extremes, during the equinoxes (around March 21st and September 21st), the sun rises due east and sets due west. The sun’s path and daylight duration are roughly the same across the globe on these days, providing a useful reference point for aligning solar systems or understanding natural lighting in architecture.

To optimize my solar setup, I pay attention to both the azimuth (the sun’s compass direction) and the altitude (its height above the horizon). Tools like sun path diagrams or solar calculators allow me to visualize how sunlight will interact with my environment throughout the year. By analyzing these trajectories, I can strategically place solar panels, plan for seasonal shading, and improve overall efficiency.

Sun Trajectory in Raeren, Belgium

Located at approximately 50.7° N latitude, Raeren experiences significant seasonal variation in the sun’s path across the sky. Understanding these local specifics is crucial for making the most of solar energy.

Summer Solstice (Around June 21)

During summer, the sun follows a high arc, ideal for solar energy generation. South-facing panels receive ample light, and even east- and west-facing surfaces can contribute significantly.

Winter Solstice (Around December 21)

In winter, the sun barely rises above the horizon. Shadows are longer, and buildings or trees may obstruct light. Solar panel tilt becomes especially important to capture the low-angled sun.

Equinoxes (Around March 21 and September 23)

The equinoxes provide a good reference point, as they represent balance — equal day and night lengths, and a moderate solar arc.

Additional Considerations

The Goal

I wanted to create a tool that offers an immediate, visual answer to the following questions:

My goal wasn’t to simulate astronomical precision with orbital mechanics or ray tracing — just to use reliable daily weather data and a clever mathematical model to interpolate the sun’s position and intensity over time.

The Data

To power the visualization, I wrote a Python script that queries the Open-Meteo API, which provides free, no-authentication-required weather forecasts and astronomical data. This script runs periodically and stores the current day's data in a JSON file, which I upload to my web server. The relevant fields include:

Once this JSON file is loaded by the frontend, I parse the sunrise and sunset values into decimal hours using JavaScript:

javascript const sunriseHour = parseFloat(today.sunrise.slice(11,13)) + parseFloat(today.sunrise.slice(14,16)) / 60; const sunsetHour = parseFloat(today.sunset.slice(11,13)) + parseFloat(today.sunset.slice(14,16)) / 60;

The Curve: Gaussian, Not Geometric

The intensity of sunlight over a day follows a bell curve, peaking at solar noon. So I model the intensity with a Gaussian function:

javascript const sigma = (sunset - sunrise) / 4; const value = Math.exp(-Math.pow(h - solarNoon, 2) / (2 * sigma * sigma));

This means: - Intensity is 0 at sunrise and sunset - It peaks at 1.0 at solar noon - The curve adapts dynamically to the day’s length

I calculate this every 15 minutes and plot it using Chart.js.

The Labels: Sunrise, Sunset, Solar Noon

Using chartjs-plugin-annotation, we highlight three vertical lines:

js annotation: { annotations: { sunriseLine: { xMin: sunriseIndex, label: { content: 'Sunrise' } }, noonLine: { xMin: noonIndex, label: { content: 'Solar Noon: 12:37' } }, sunsetLine: { xMin: sunsetIndex, label: { content: 'Sunset' } } } }

Each is color-coded: - Blue for sunrise - Red for sunset - Orange highlight for solar noon

The Charts

I use two line charts:

  1. Today’s Sun Curve
    Shows the Gaussian intensity for the current day, including the key times as annotations.
  2. Sunshine Duration Chart
    Plots sunshine_duration values for the next twoo weeks.

This combination gives us both context and detail — how long the sun shines, and how its power varies throughout the day.

Why It Works

Instead of simulating the sun’s physical path, I used available data and statistical modeling to mimic solar intensity in a visually intuitive way.

It’s fast, smooth, and good enough to: - Inform charging strategies - Estimate solar production - Satisfy curiosity about when the day “peaks”

And honestly? It looks great on a wall-mounted info screen.

Bonus: Why Gaussian?

I chose to model sunlight intensity over time using a Gaussian curve — also known as a normal distribution or bell curve — and there's a solid rationale behind this decision.

First, the shape of a Gaussian curve closely mirrors the natural rhythm of daylight: a gradual rise in intensity after sunrise, peaking around solar noon, followed by a symmetrical decline until sunset. This behavior makes it an intuitive and visually satisfying representation of the sun’s progression across the sky.

Here’s why it works so well for this purpose:

Of course, this approach isn’t astrophysically precise — it doesn’t simulate atmospheric effects, solar elevation, or eccentric orbits — but that’s by design. My priority is to visually approximate the sun’s behavior using minimal input (just sunrise and sunset). And for that, the Gaussian model is a near-perfect balance of simplicity, clarity, and realism.

In short: it's good enough to be useful, and elegant enough to be beautiful.

The Result

If you haven’t seen it yet, check out the live Sonnenverlauf page — it’s the culmination of a project that began with a simple question about solar noon and evolved into a fully dynamic visualization of the sun’s path through the sky.

This page does more than just draw a line on a chart. It visualizes the daily arc of the sun, marking: - Sunrise and sunset times - The moment of solar noon - The intensity of sunlight throughout the day, modeled with a smooth Gaussian curve - The total daylight duration, which shifts subtly with the seasons

All of this is driven not by satellite tracking or complex orbital simulations, but by a local JSON file populated with accurate astronomical data from the Open-Meteo API. The result is a responsive, low-resource, and highly informative display that reflects real-world solar behavior — calculated precisely, without overengineering.

Whether I’m checking the best time for solar charging, evaluating seasonal daylight changes, or simply admiring how short Belgian winter days really are, this dashboard delivers insight with elegance and simplicity.

It turns out that even something as majestic and timeless as a sunrise can, in fact, be measured and modeled. With the right data, a bit of thoughtful mathematics, and some clean visualization, I’ve transformed what’s usually perceived as a purely poetic event into a structured, accessible, and insightful experience. By grounding this daily phenomenon in numbers, I’ve made it not just understandable, but personally relevant — a celestial rhythm I can watch, predict, and even optimize around.