Module: AstroChart::Profection

Defined in:
lib/astro_chart/profection.rb

Overview

Annual profection (小限法) — the traditional time-lord technique where each completed year of life advances the point of emphasis by one whole sign from the ascendant. Age 0 activates the 1st house (the ASC sign), age 1 the 2nd, and so on, cycling every 12 years. The traditional ruler of the profected sign is the Lord of the Year (年主星), the year's principal significator.

Pure arithmetic on the ascendant longitude and an age in whole years.

Class Method Summary collapse

Class Method Details

.annual(ascendant, age) ⇒ Object

ascendant: ecliptic longitude of the ASC (degrees, 0-360) age: completed years of life (integer ≥ 0)

Returns:

{ "age" => 36, "profected_house" => 1, "profected_sign" => "牡羊座",
"year_lord" => "火星" }

Raises:

  • (ArgumentError)


23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/astro_chart/profection.rb', line 23

def annual(ascendant, age)
  raise ArgumentError, "age must be a non-negative integer" if age.nil? || age < 0

  asc_sign_index = (ascendant % 360).floor / 30
  steps = age % 12
  sign = Zodiac::SIGNS[(asc_sign_index + steps) % 12]

  {
    "age"             => age,
    "profected_house" => steps + 1,
    "profected_sign"  => sign,
    "year_lord"       => Dignities::DOMICILE[sign],
  }
end

.at(ascendant, birth_date, target_date) ⇒ Object

Convenience: derive the age (completed years) from birth and target dates (each a "YYYY-MM-DD" string or Date) and profect.



40
41
42
# File 'lib/astro_chart/profection.rb', line 40

def at(ascendant, birth_date, target_date)
  annual(ascendant, completed_years(to_date(birth_date), to_date(target_date)))
end

.completed_years(birth, target) ⇒ Object

Whole years elapsed from birth to target (the person's age).



45
46
47
48
49
50
# File 'lib/astro_chart/profection.rb', line 45

def completed_years(birth, target)
  years = target.year - birth.year
  had_birthday = (target.month > birth.month) ||
                 (target.month == birth.month && target.day >= birth.day)
  had_birthday ? years : years - 1
end

.to_date(value) ⇒ Object



52
53
54
# File 'lib/astro_chart/profection.rb', line 52

def to_date(value)
  value.is_a?(Date) ? value : Date.parse(value)
end