<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Quiet Orbit</title>
    <description>The latest articles on DEV Community by Quiet Orbit (@quietorbit).</description>
    <link>https://dev.to/quietorbit</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4218307%2Fa9deb0eb-53f0-40dc-8e81-deffbbd66520.png</url>
      <title>DEV Community: Quiet Orbit</title>
      <link>https://dev.to/quietorbit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/quietorbit"/>
    <language>en</language>
    <item>
      <title>Finding your Saturn return in JavaScript (and why retrograde makes it messy)</title>
      <dc:creator>Quiet Orbit</dc:creator>
      <pubDate>Wed, 04 Nov 2026 02:24:29 +0000</pubDate>
      <link>https://dev.to/quietorbit/finding-your-saturn-return-in-javascript-and-why-retrograde-makes-it-messy-jm8</link>
      <guid>https://dev.to/quietorbit/finding-your-saturn-return-in-javascript-and-why-retrograde-makes-it-messy-jm8</guid>
      <description>&lt;p&gt;Astrologers talk about the "Saturn return": the moment Saturn comes back to the same position it had in the sky when you were born. Whatever you think of astrology, the question underneath it is a clean astronomy problem: &lt;em&gt;on which dates does Saturn return to a given ecliptic longitude?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I built a small browser calculator for it, and this post covers the part that surprised me: the obvious shortcut is wrong, and the correct answer sometimes has three dates instead of one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The shortcut that does not work
&lt;/h2&gt;

&lt;p&gt;Saturn's orbital period is about 29.46 years, so the obvious approach is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;firstReturn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;birth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getTime&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;29.46&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;365.2422&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;86400000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That gets you close, but not close enough. Saturn's orbit is slightly elliptical, so it moves faster in some parts of the zodiac and slower in others. When I computed the first return for people born at the edges of each of Saturn's sign periods, the age at the first return ranged from about 28.4 to 29.8 years. That is a spread of more than a year, so adding a constant gives you a date that can be wrong by months.&lt;/p&gt;

&lt;h2&gt;
  
  
  The approach that does work
&lt;/h2&gt;

&lt;p&gt;Compute Saturn's actual ecliptic longitude for any date, then search for the dates where it equals your birth longitude. I used &lt;a href="https://github.com/cosinekitty/astronomy" rel="noopener noreferrer"&gt;Astronomy Engine&lt;/a&gt;, which runs in the browser and in Node:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;longitude&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Astronomy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;MakeTime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;v&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Astronomy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GeoVector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Astronomy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Saturn&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// true = correct for light travel time&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;Astronomy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Ecliptic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;v&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;elon&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// degrees, 0 to 360&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One thing to check with any library: the zodiac signs used in Western astrology are measured from the March equinox &lt;em&gt;of the date&lt;/em&gt;, so make sure you are getting ecliptic longitude of date, not of a fixed epoch like J2000. I check against a published table before trusting any result.&lt;/p&gt;

&lt;h2&gt;
  
  
  The retrograde problem
&lt;/h2&gt;

&lt;p&gt;Seen from Earth, Saturn spends about four and a half months of every year moving backwards against the stars. If your natal degree happens to sit where one of those loops falls, Saturn crosses it &lt;strong&gt;three times&lt;/strong&gt;: forward, back, then forward again. So "the date of the return" is not always one date.&lt;/p&gt;

&lt;p&gt;The search therefore has to find all crossings in a window, not just the first one. I scan in two-day steps, look for a sign change in the signed angular difference, and then bisect to refine each crossing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// signed difference between two longitudes, in the range -180..180&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;angDiff&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;540&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;360&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;180&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;crossings&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;step&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;86400000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;d0&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;angDiff&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;longitude&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt; &lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;step&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;t&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;step&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;t&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;step&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;d1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;angDiff&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;longitude&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt; &lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// ignore wrap-around jumps near +/-180&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;d0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;90&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;d1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;90&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sign&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;d0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sign&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;d1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;t&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;step&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;hi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;            &lt;span class="c1"&gt;// bisection&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;hi&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;angDiff&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;longitude&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mid&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt; &lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sign&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dm&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sign&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;d0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="nx"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;mid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nx"&gt;hi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;mid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="nx"&gt;out&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;hi&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;d0&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;d1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;out&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(This is a simplified version of what the calculator does.) The first return is then &lt;code&gt;crossings(natalLongitude, birth + 26 years, birth + 32 years)&lt;/code&gt;, the second in a window around 55 to 63 years, and the third around 84 to 92. Searching a wide window and letting the crossings fall out is much safer than guessing a date.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the result looks like
&lt;/h2&gt;

&lt;p&gt;For most people the window holds a single crossing. For some it holds three. Someone born on 10 January 1990, for example, gets crossings on 17 February, 16 July and 17 November 2019, while someone born on 15 June 1994 gets a single one, on 21 March 2024. That spread is why the Saturn return is described as lasting a period rather than a day.&lt;/p&gt;

&lt;p&gt;I turned the calculation into a lookup too. &lt;a href="https://zodiaccalculators.com/saturn-return-by-birth-year/" rel="noopener noreferrer"&gt;Saturn return by birth year&lt;/a&gt; lists the natal Saturn sign and the first-return window for birth dates from late 1929 to 2012, and the &lt;a href="https://zodiaccalculators.com/saturn-return-calculator/" rel="noopener noreferrer"&gt;Saturn return calculator&lt;/a&gt; gives the exact dates for your own birth date, all in the browser with no data sent anywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  Notes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The positions are an astronomical calculation. What a Saturn return &lt;em&gt;means&lt;/em&gt; is astrological tradition, not science; I treat that part as entertainment.&lt;/li&gt;
&lt;li&gt;I checked the code against known sign changes (for example Saturn entering Pisces in March 2023) before trusting it.&lt;/li&gt;
&lt;li&gt;If you build something similar, test dates near sign boundaries and dates when Saturn is retrograde. Those are where the bugs hide.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you try it and find a date that looks wrong, I would like to hear about it in the comments.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Finding Chiron's zodiac sign in the browser, from NASA JPL orbit data</title>
      <dc:creator>Quiet Orbit</dc:creator>
      <pubDate>Sat, 31 Oct 2026 05:31:48 +0000</pubDate>
      <link>https://dev.to/quietorbit/finding-chirons-zodiac-sign-in-the-browser-from-nasa-jpl-orbit-data-4083</link>
      <guid>https://dev.to/quietorbit/finding-chirons-zodiac-sign-in-the-browser-from-nasa-jpl-orbit-data-4083</guid>
      <description>&lt;p&gt;Most "what is my Chiron sign" tools need a server, or lean on a library that has no support for minor bodies. I wanted one that runs entirely in the browser, with nothing sent anywhere, and that I could check against real data. Here is how I built it, and the one bug that cost me an afternoon.&lt;/p&gt;

&lt;p&gt;The result is a set of free calculators at &lt;a href="https://zodiaccalculators.com/" rel="noopener noreferrer"&gt;zodiaccalculators.com&lt;/a&gt;: Venus, Saturn return, North Node, Chiron, Juno and Black Moon Lilith.&lt;/p&gt;

&lt;h2&gt;
  
  
  Planets are easy, minor bodies are not
&lt;/h2&gt;

&lt;p&gt;For Venus and Saturn I used &lt;a href="https://github.com/cosinekitty/astronomy" rel="noopener noreferrer"&gt;Astronomy Engine&lt;/a&gt; (MIT licence). It gives geocentric positions in the browser with a small footprint. I take the apparent position, convert to ecliptic longitude of date (the tropical zodiac that Western astrology uses), and divide by 30 to get the sign.&lt;/p&gt;

&lt;p&gt;Chiron and Juno are different. Astronomy Engine does not include them, and shipping a full ephemeris file to every visitor is not realistic. The data comes from NASA/JPL Horizons, which publishes orbit files for individual small bodies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pre-computing a table instead of shipping an ephemeris
&lt;/h2&gt;

&lt;p&gt;I did the heavy work once, offline, in Python:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download the SPK orbit files for Chiron and Juno from Horizons.&lt;/li&gt;
&lt;li&gt;With Skyfield and the DE440s planetary ephemeris, compute the apparent ecliptic longitude of date for every day from 1900 to 2099, at noon UT.&lt;/li&gt;
&lt;li&gt;Store each longitude as a 16-bit integer in units of 0.01 degree.&lt;/li&gt;
&lt;li&gt;Base64-encode the whole array into a JavaScript file.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is 73,049 values, about 190 KB per body after base64. In the browser, a lookup is a base64 decode, then linear interpolation between two daily values. Because these bodies move slowly, I measured the interpolation error against the exact calculation and it stayed below 0.006 degrees. A sign is 30 degrees wide, so that is irrelevant for anything but the last minutes before a sign change.&lt;/p&gt;

&lt;h2&gt;
  
  
  The sign-change problem
&lt;/h2&gt;

&lt;p&gt;If someone was born on a day when the body crossed from one sign into the next, the right answer depends on the time and the time zone. The tool does not guess. It scans every hour across the longest possible span of that calendar date (from UTC+14 to UTC-12) and, if more than one sign appears, shows both and asks for a birth time and offset.&lt;/p&gt;

&lt;h2&gt;
  
  
  The lunar nodes, and the bug
&lt;/h2&gt;

&lt;p&gt;Black Moon Lilith and the mean node come from the polynomial formulas in Jean Meeus, &lt;em&gt;Astronomical Algorithms&lt;/em&gt;. The true node is the osculating node of the Moon's orbit, which I calculate from the Moon's geocentric state vector.&lt;/p&gt;

&lt;p&gt;This is where I lost the afternoon. My results were consistently off by 0.33 to 0.38 degrees for dates in the 2020s, and the error grew steadily over the decades. I had added a precession correction, and it turned out the coordinate frame I was already using had precession accounted for. I was applying it twice. Removing the extra term brought the values in line with published ingress tables, down to the day. A growing, linear error over time is a good sign that you have double-counted something time-dependent.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I checked it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Venus and Saturn against NASA JPL's DE440 ephemeris at a spread of dates.&lt;/li&gt;
&lt;li&gt;Chiron against Skyfield with the same orbit file, and against published sign-ingress tables.&lt;/li&gt;
&lt;li&gt;The mean and true node against published ingress tables.&lt;/li&gt;
&lt;li&gt;Juno through the same pipeline as Chiron, plus an orbital-element check. I could not find an independent published table for it, so that is the weakest validation of the set, and I say so on the site.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I would do differently
&lt;/h2&gt;

&lt;p&gt;I would have started with the independent check. Writing a comparison against a published table first would have shown the precession error in minutes instead of hours.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;If you are curious what your own placement looks like, the &lt;a href="https://zodiaccalculators.com/chiron-calculator/" rel="noopener noreferrer"&gt;Chiron calculator&lt;/a&gt; and &lt;a href="https://zodiaccalculators.com/north-node-calculator/" rel="noopener noreferrer"&gt;North Node calculator&lt;/a&gt; both run fully client-side, and the position data is just a static file you can inspect in your browser's network tab.&lt;/p&gt;

&lt;p&gt;The astronomy is a calculation. The meanings attached to it are astrological tradition, not science, and the site says so.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>astronomy</category>
      <category>webdev</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
