{
  "schemaVersion": 1,
  "slug": "zodiac-sign-calculator",
  "category": "date-time",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "1be614374d125aaed70ee6f54fc7d2d7b08c67f7271011e63d251cf7c3fdc43b",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/zodiac-sign-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "K = month × 100 + day; sign = fixedThresholdLookup(K)",
    "vars": [
      [
        "month",
        "Birth month (1–12)"
      ],
      [
        "day",
        "Birth day"
      ],
      [
        "K",
        "Month-day code"
      ],
      [
        "sign",
        "Western sun-sign label"
      ]
    ],
    "note": "A fixed month-and-day threshold table is evaluated using the UTC date input. This is not an astronomical ephemeris; the same month and day always map to the same sign."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const m=/^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(String(birthDate));if(!m)return {zodiacSign:null,__error:'inputError'};const d=new Date(birthDate+'T00:00:00Z');if(!Number.isFinite(d.getTime())||d.getUTCFullYear()!==+m[1]||d.getUTCMonth()+1!==+m[2]||d.getUTCDate()!==+m[3])return {zodiacSign:null,__error:'inputError'};const md=(d.getUTCMonth()+1)*100+d.getUTCDate();let i;if(md>=1222||md<120)i=0;else if(md<219)i=1;else if(md<321)i=2;else if(md<420)i=3;else if(md<521)i=4;else if(md<621)i=5;else if(md<723)i=6;else if(md<823)i=7;else if(md<923)i=8;else if(md<1023)i=9;else if(md<1122)i=10;else i=11;return {zodiacSign:['Capricorn','Aquarius','Pisces','Aries','Taurus','Gemini','Cancer','Leo','Virgo','Libra','Scorpio','Sagittarius'][i]};",
    "inputs": [
      {
        "name": "birthDate",
        "type": "date",
        "default": "1990-06-15",
        "step": 1
      }
    ],
    "outputs": [
      {
        "name": "zodiacSign",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": [
      {
        "max": 1.5,
        "key": "s1"
      },
      {
        "max": 2.5,
        "key": "s2"
      },
      {
        "max": 3.5,
        "key": "s3"
      },
      {
        "max": 4.5,
        "key": "s4"
      },
      {
        "max": 5.5,
        "key": "s5"
      },
      {
        "max": 6.5,
        "key": "s6"
      },
      {
        "max": 7.5,
        "key": "s7"
      },
      {
        "max": 8.5,
        "key": "s8"
      },
      {
        "max": 9.5,
        "key": "s9"
      },
      {
        "max": 10.5,
        "key": "s10"
      },
      {
        "max": 11.5,
        "key": "s11"
      },
      {
        "max": 1000000000,
        "key": "s12"
      }
    ]
  }
}
