Skip to content

Draw the ecliptic - #20

Merged
rhannequin merged 3 commits into
mainfrom
ecliptic
Oct 28, 2026
Merged

rhannequin merged 3 commits into
mainfrom
ecliptic

Conversation

@rhannequin

Copy link
Copy Markdown
Owner

Adds Skymap::Layers::Ecliptic, which draws the line the Sun follows in the sky. It stops at the horizon, like the constellation boundaries.

The line is the great circle of the J2000 ecliptic, sampled every degree and run through Astronoby like the other J2000 points, so it is precessed to the date of the map. It is drawn in a muted gold, thin and solid, so it stays behind the stars.

The code that cuts a line at the horizon moved from ConstellationBoundaries to Horizon.visible_runs, so both layers use it. The boundaries behave as before.

On a map the line starts and ends at the same point of the circle, so when that point is above the horizon, the line can come as two pieces that touch. They look like one line.

The sample map in the README now shows it.

Add a layer that draws the line the Sun follows in the sky, stopping at
the horizon. The clipping at the horizon that the constellation
boundaries use now lives in Horizon, so both layers share it.
Join the two pieces of the ecliptic at the seam so it is one line, compute
the obliquity once, and keep the Horizon helpers private. Move
distance_from_center to the spec helpers and add specs for
Horizon.visible_runs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The review identifies no active issues in the optional ecliptic layer or shared horizon-clipping changes.

No open issues 🎉

What changed in this PR

Adds an optional ecliptic layer to Skymap, using the existing coordinate conversion and SVG rendering pipeline to draw the Sun’s annual path across the sky.

Changes:

  • Samples the J2000 ecliptic at one-degree intervals and renders it as a thin, solid gold line.
  • Shares horizon clipping between the ecliptic and constellation boundaries.
  • Adds geometry and rendering specs, documents the layer, and updates the sample map.
File Description
spec/​support/​geometry_helpers.rb Extracts a shared distance helper for geometry specs.
spec/​skymap/​renderer/​svg_spec.rb Checks ecliptic polyline formatting and styling.
spec/​skymap/​layers/​ecliptic_spec.rb Covers Sun alignment, continuity, horizon clipping, and width scaling.
spec/​skymap/​layers/​constellation_boundaries_spec.rb Uses the shared geometry helper.
spec/​skymap/​horizon_spec.rb Covers visible runs and horizon crossings.
sky_map.svg Adds the ecliptic to the sample map.
README.md Documents the layer and updates the sample image description.
lib/​skymap/​renderer/​svg.rb Adds solid gold ecliptic rendering.
lib/​skymap/​renderer/​ecliptic.rb Defines the ecliptic rendering data object.
lib/​skymap/​layers/​ecliptic.rb Generates, clips, and joins sampled ecliptic points.
lib/​skymap/​layers/​constellation_boundaries.rb Delegates horizon clipping to the shared helper.
lib/​skymap/​horizon.rb Extracts reusable visible-run clipping logic.
lib/​skymap.rb Loads the new layer and rendering object.
CHANGELOG.md Records the new ecliptic layer.

Review effort: Balanced

@rhannequin
rhannequin merged commit 102f79e into main Oct 28, 2026
5 checks passed
@rhannequin
rhannequin deleted the ecliptic branch October 28, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants