Astro-Montenbruck
view release on metacpan or search on metacpan
lib/Astro/Montenbruck/RiseSet.pm view on Meta::CPAN
my ($state) = shift;
$arg{on_noevent}->(@_);
my $evt =
$state eq $STATE_NEVER_RISES ? $EVT_RISE : $EVT_SET;
$res{$evt} = { ok => 0, state => $state };
}
);
return %res;
}
# if caller doesn't ask for a result, just call the function with the callbacks
$func->(
get_position => sub { _get_equatorial( $pla, $_[0] ) },
sin_h0 => sin( deg2rad($h0) ),
on_event => $arg{on_event},
on_noevent => $arg{on_noevent},
);
}
}
sub rst {
lib/Astro/Montenbruck/RiseSet.pm view on Meta::CPAN
$res{$_} = { ok => 1, jd => $jd };
}
else {
$arg{on_noevent}->( $_, $state );
$res{$_} = { ok => 0, state => $state };
}
}
return %res;
}
# if caller doesn't ask for a result, just call the function with the callbacks
for (@RS_EVENTS) {
my ( $state, $jd ) = $evt_func->($_);
if ( $state eq $_ ) {
$arg{on_event}->( $_, $jd );
}
else {
$arg{on_noevent}->( $_, $state );
}
}
}
lib/Astro/Montenbruck/RiseSet.pm view on Meta::CPAN
=item *
B<lambda> - geographical longitude, degrees, positive westward
=back
=head3 Returns
function, which calculates rise, set and transit for a celestial body.
It accepts celestial body identifier as positional argument (see L<Astro::Montenbruck::Ephemeris::Planet>)
and two optional callbacks as named arguments:
=over
=item *
B<on_event($event, $jd> - callback called when the event time is determined. The first argument
is one of: C<$EVT_RISE>, C<$EVT_SET> or C<$EVT_TRANSIT> constants (see L<Astro::Montenbruck::RiseSet::Constants>),
the second - I<Standard Julian Date>.
=item *
lib/Astro/Montenbruck/RiseSet.pm view on Meta::CPAN
B<phi> - geographical latitude, degrees, positive northward
=item *
B<lambda> - geographical longitude, degrees, positive westward
=back
=head3 Returns
function, which calculates rise and set times of the planet. It accepts and two callbacks as named arguments:
=over
=item *
B<on_event($event, $jd>)
callback called when the event time is determined. The first argument
is one of: C<$EVT_RISE>, C<$EVT_SET> or C<$EVT_TRANSIT> constants (see L<Astro::Montenbruck::RiseSet::Constants>),
the second - I<Standard Julian Date>.
( run in 0.325 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )