sin example

// radiant conversion for coordinates         $radLatitude  = $location['latitude']   * $halfCircle / 180;
        $radLongitude = $location['longitude']  * $halfCircle / 180;

        // get solar coordinates         $tmpRise       = $rise ? $quarterCircle : $threeQuarterCircle;
        $radDay        = $this->date('z',$this->_unixTimestamp) + ($tmpRise - $radLongitude) / $fullCircle;

        // solar anomoly and longitude         $solAnomoly    = $radDay * 0.017202 - 0.0574039;
        $solLongitude  = $solAnomoly + 0.0334405 * sin($solAnomoly);
        $solLongitude += 4.93289 + 3.49066E-4 * sin(2 * $solAnomoly);

        // get quadrant         $solLongitude = $this->_range($solLongitude$fullCircle);

        if (($solLongitude / $quarterCircle) - intval($solLongitude / $quarterCircle) == 0) {
            $solLongitude += 4.84814E-6;
        }

        // solar ascension         $solAscension = sin($solLongitude) / cos($solLongitude);
        
$imprecision = 0;
      $correction = 0;
    }
    else {
      $imprecision = -0.00001;
      $correction = 0.5;
    }

    // Do the trigonometry, applying imprecision fixes where needed.     $rad = deg2rad($angle);
    $cos = cos($rad);
    $sin = sin($rad);
    $a = $this->width * $cos;
    $b = $this->height * $sin + $correction;
    $c = $this->width * $sin;
    $d = $this->height * $cos + $correction;
    if ((int) $angle == $angle && in_array($angle[60, 150, 300])) {
      $a = $this->fixImprecision($a$imprecision);
      $b = $this->fixImprecision($b$imprecision);
      $c = $this->fixImprecision($c$imprecision);
      $d = $this->fixImprecision($d$imprecision);
    }

    
Home | Imprint | This part of the site doesn't use cookies.