Calculation engines

Formula specs and code samples for the three engines that power Molino. Open source, auditable, no black boxes.

Numerology Engine

Calculates Life Path, Expression, Personality and Life Cycles. Life Path, Personality and Cycles come from the date of birth; Expression, from the full name.

Life Path

Reductive sum of DD + MM + YYYY → digit 1-9 (11, 22, 33 as masters)

15/03/1990 → 1+5+0+3+1+9+9+0 = 28 → 2+8 = 10 → 1+0 = 1

Expression (Destiny)

Sum of the Pythagorean values of each letter of the full name → reduced to 1-9

JOHN SMITH → J(1)+O(6)+H(8)+N(5) + S(1)+M(4)+I(9)+T(2)+H(8) = 44 → 4+4 = 8

Personality

It comes exclusively from the day of birth (not from the name): the day of the month reduced to a single digit, or kept as is if it's 11/22/33.

Born on the 9th, 18th or 27th → Personality 9. Born on the 15th → 1+5 = 6.

Life Cycles (Pinnacles/Challenges)

Based on the date of birth: 4 cycles of ~27-28 years each

Cycle 1: ages 0-27, Cycle 2: 28-55, Cycle 3: 56-83, Cycle 4: 84+

TypeScript — Reference implementation
// Cálculo Camino de Vida (simplificado)
function lifePath(day: number, month: number, year: number): number {
  const sum = digits(day) + digits(month) + digits(year);
  return reduceToMaster(sum); // 1-9, 11, 22, 33
}

// Valores pitagóricos A=1, B=2... I=9, J=1...
const PYTHAGOREAN: Record<string, number> = {
  A:1, J:1, S:1, B:2, K:2, T:2, C:3, L:3, U:3,
  D:4, M:4, V:4, E:5, N:5, W:5, F:6, O:6, X:6,
  G:7, P:7, Y:7, H:8, Q:8, Z:8, I:9, R:9
};

Tropical Astrology Engine

Calculates the sun and moon signs from your date of birth.

Sun Sign

Geocentric position of the Sun in the zodiac at the exact moment of birth

Sun at 23°15' Aries → Sign: Aries, Degree: 23°15'

Moon Sign

Geocentric position of the Moon (fast: ~13°/day, requires exact time)

Moon at 12°40' Cancer → Sign: Cancer

Element / Modality

Direct mapping sign → element (Fire/Earth/Air/Water) and sign → modality (Cardinal/Fixed/Mutable)

Aries → Element: Fire, Modality: Cardinal

TypeScript — Reference implementation
// Cálculo signo solar (aprox., sin efemérides)
function sunSign(day: number, month: number): string {
  const boundaries = [
    [20, 1, "Acuario"], [19, 2, "Piscis"], [21, 3, "Aries"],
    [20, 4, "Tauro"], [21, 5, "Géminis"], [21, 6, "Cáncer"],
    [23, 7, "Leo"], [23, 8, "Virgo"], [23, 9, "Libra"],
    [23, 10, "Escorpio"], [22, 11, "Sagitario"], [22, 12, "Capricornio"]
  ];
  for (const [d, m, sign] of boundaries) {
    if (month === m && day <= d) return sign;
  }
  return "Capricornio";
}

// Para precisión real: Swiss Ephemeris (sweph)
// swe_calc_ut(jd, SE_SUN, SEFLG_SPEED, &pos, &ret);
// signo = Math.floor(pos[0] / 30);

Chinese Zodiac Engine

Determines the animal of the year, the element, the pillars (Year, Month, Day, Hour) and the sexagenary cycle (60 combinations) using the Chinese lunisolar calendar.

Animal of the Year

(Year - 4) % 12 → index 0-11: Rat, Ox, Tiger, Rabbit, Dragon, Snake, Horse, Goat, Monkey, Rooster, Dog, Pig

1990 → (1990-4)%12 = 6 → Horse

Element of the Year

Floor((Year - 4) % 10 / 2) → 0:Wood, 1:Fire, 2:Earth, 3:Metal, 4:Water

1990 → (1986%10)/2 = 3 → Metal → Metal Horse

Sexagenary Cycle (Ganzhi)

Combination of 10 Heavenly Stems × 12 Earthly Branches = 60 unique pairs

1990 = Geng Wu (Metal Horse) - year 27 of the cycle

Month Pillar

Based on the Chinese solar month (Jieqi) + year; uses correspondence tables

March 1990 → Month Pillar: Ji Mao (Earth Rabbit)

Day Pillar

Counts days from a base epoch (e.g. 1900-01-01 = Jia Zi) modulo 60

03/15/1990 → Day #32874 → 32874%60 = 54 → Ding Hai

Hour Pillar

Each Chinese hour = 2 Western hours; 12 hours × 5 elements = cycle of 60

14:30 → Wei Hour (13-15h) → Hour Pillar depending on the day

TypeScript — Reference implementation
// Animal y Elemento del Año
const ANIMALES = [
  "Rata", "Buey", "Tigre", "Conejo", "Dragón", "Serpiente",
  "Caballo", "Cabra", "Mono", "Gallo", "Perro", "Cerdo"
];

const ELEMENTOS = ["Madera", "Fuego", "Tierra", "Metal", "Agua"];

function chineseYearInfo(year: number) {
  const offset = year - 4; // 1984 = Jia Zi (Madera Rata) = inicio ciclo 60
  const animalIdx = ((offset % 12) + 12) % 12;
  const elementIdx = Math.floor((((offset % 10) + 10) % 10) / 2);
  return {
    animal: ANIMALES[animalIdx],
    elemento: ELEMENTOS[elementIdx],
    ganzhiIndex: ((offset % 60) + 60) % 60 // 0-59
  };
}

// Para pilares exactos: requiere conversión fecha gregoriana → calendario chino
// Librería recomendada: chinese-calendar o implementación propia de Jieqi

All the formulas are reference implementations. The production engines use Swiss Ephemeris for planetary positions with astronomical precision and validated libraries for Chinese calendar conversion.