Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $ffi = FFI::load(__DIR__ . '/astro.h');
- $dayNr = (time() - 946598400) / 86400.0;
- echo $dayNr, "\n";
- $L = FFI::new('double');
- $M = FFI::new('double');
- $ra= FFI::new('double');
- $decl= FFI::new('double');
- $rad = FFI::new('double');
- $ffi->sunpos($dayNr, FFI::addr($L), FFI::addr($M), FFI::addr($ra), FFI::addr($decl), FFI::addr($rad));
- $sidtime = FFI::new('double');
- $ha = FFI::new('double');
- $ffi->sidtime_and_ha($L->cdata, ($dayNr - floor($dayNr)) * 24, 0, $ra->cdata, FFI::addr($sidtime), FFI::addr($ha));
- $azimuth = FFI::new('double');
- $altitude = FFI::new('double');
- $ffi->sunaltazimuth($L->cdata, 52, $ha->cdata, $decl->cdata, FFI::addr($azimuth), FFI::addr($altitude));
- var_dump($altitude);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement