Module: Ephemeris::Zodiac::Aspect::Trine

Defined in:
lib/ephemeris/zodiac/aspect.rb

Class Method Summary collapse

Class Method Details

.build_appropriate_motion_from_position(position) ⇒ Object



86
87
88
89
90
91
92
93
94
95
96
# File 'lib/ephemeris/zodiac/aspect.rb', line 86

def self.build_appropriate_motion_from_position( position )
  if (0...120).cover? position
    return [ 120, 240 ]
  elsif (120...240).cover? position
    return [ 120, -120 ]
  elsif (240...360).cover? position
    return [ -120, -240 ]
  else
    raise StandardError.new("There are only 360 degress in a circle, buddy.")
  end
end

.trine?(planet_1, planet_2) ⇒ Boolean

Returns:

  • (Boolean)


79
80
81
82
83
84
# File 'lib/ephemeris/zodiac/aspect.rb', line 79

def self.trine?( planet_1, planet_2 )
  orb = Ephemeris::Zodiac::Aspect.orb_range_defined_by_target( planet_1, planet_2 )
  calc = self.build_appropriate_motion_from_position( orb.target.position )

  orb.cover?( calc ) # already an array
end