Ejemplo n.º 1
0
 /**
  * Set Data
  * 
  * @param \Jyotish\Base\Data $Data
  * @return \Jyotish\Yoga\Type\Dhana
  */
 public function setData(\Jyotish\Base\Data $Data)
 {
     $this->Data = $Data;
     $Lg = Bhava::getInstance(1)->setEnvironment($this->Data);
     $this->temp['lgAspect'] = $Lg->isAspectedByGraha();
     $this->temp['lgConjunct'] = $Lg->isConjuncted();
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * Lord of 10th house combined with 4 planets in Kendra/Trikona.
  * 
  * @return bool
  * @see Mantreswara. Phaladeepika. Chapter 27, Verse 1.
  */
 public function hasL10C4GrInKnTr()
 {
     $B10 = Bhava::getInstance(10)->setEnvironment($this->Data);
     $r10 = $B10->getRuler();
     $R10 = Graha::getInstance($r10)->setEnvironment($this->Data);
     $r10Bhava = $R10->getBhava();
     $r10Rashi = $this->getData()[Data::BLOCK_GRAHA][$r10]['rashi'];
     if (in_array($r10Bhava, $this->temp['kendraAndTrikona'])) {
         $inKendraTrikona[] = $r10;
         foreach (Graha::$graha as $grahaKey => $grahaName) {
             if ($grahaKey == $r10) {
                 continue;
             }
             if ($r10Rashi == $this->getData()[Data::BLOCK_GRAHA][$grahaKey]['rashi']) {
                 $inKendraTrikona[] = $grahaKey;
             }
         }
         return count($inKendraTrikona) >= 5 ? true : false;
     } else {
         return false;
     }
 }
Ejemplo n.º 3
0
 /**
  * Arudha calculation.
  * 
  * @param string $key Arudha key
  * @param null|array $options Options to set (optional)
  * @return array
  * @throws Exception\InvalidArgumentException
  */
 public function getArudha($key, array $options = null)
 {
     $this->checkData();
     if (!array_key_exists($key, self::$arudha)) {
         throw new Exception\InvalidArgumentException("Arudha with the key '{$key}' does not exist.");
     }
     if ($key == self::KEY_AL) {
         $bhavaKey = 1;
     } elseif ($key == self::KEY_UL) {
         $bhavaKey = 12;
     } else {
         $bhavaKey = substr($key, 1);
     }
     $Bhava = Bhava::getInstance($bhavaKey)->setEnvironment($this->Data);
     $bhavaRuler = $Bhava->getRuler();
     $lngRuler = $this->getData()['graha'][$bhavaRuler]['longitude'];
     $lngBhava = $this->getData()['bhava'][$bhavaKey]['longitude'];
     $lngDiff = $lngRuler - $lngBhava;
     $lngArudha = $lngRuler + $lngDiff;
     if ($lngArudha >= 360) {
         $lngArudha = $lngArudha - 360;
     } elseif ($lngArudha < 0) {
         $lngArudha = 360 + $lngArudha;
     }
     $unitArudha = Math::partsToUnits($lngArudha);
     $rashiArudha = $unitArudha['units'];
     if ($this->optionUseException) {
         if (Math::inRange($lngDiff, 0 - $this->optionExceptionRang, $this->optionExceptionRang) || Math::inRange(abs($lngDiff), 90 - $this->optionExceptionRang, 90 + $this->optionExceptionRang)) {
             $rashiArudha = Math::numberInCycle($unitArudha['units'], 10);
             $lngArudha = ($rashiArudha - 1) * 30 + $unitArudha['parts'];
         }
     }
     return ['longitude' => $lngArudha, 'rashi' => $rashiArudha, 'degree' => $unitArudha['parts']];
 }