Skip to content

Bug in Moonphase & Moonangle #5

Description

@slarta

Hello gregseth!

PHP 5.6.3 (cli) (built: Nov 14 2014 20:21:33)
Zend Engine v2.6.0
with Zend OPcache v7.0.4-dev

<?php 
date_default_timezone_set('UTC');
include 'suncalc.php';
$timestampinput = '367930576.999999';
$datetime = new DateTime();
$datetime->setTimestamp($timestampinput);
$suncalc = new SunCalc($datetime, 0.0, 0.0);
$moonillumination = $suncalc->getMoonIllumination();
$moonfraction = $moonillumination["fraction"];
$moonphase = $moonillumination["phase"];
$moonangle = $moonillumination["angle"];
echo "Timestamp: $timestampinput";
echo "Fraction: $moonfraction";
echo "Phase: $moonphase";
echo "Angle: $moonangle";
?>

Timestamp: 367930576.999999
Fraction: 0.00055706175882264
Phase: 0.99248650278035
Angle: 3.1415787022219

Timestamp: 367930577.000000
Fraction: 0.00055704489929154
Phase: 0.0075133834992909
Angle: -3.1415560468408

There is a jump in the moon phase of 0.0150268807 and a jump in the moon angle of 6.2831347491 within a microsecond. Normally this must be several minutes difference.

Please answer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions