Astro-satpass

 view release on metacpan or  search on metacpan

lib/Astro/Coord/ECI/Sun.pm  view on Meta::CPAN

    O  = @{[rad2deg ($O)]} degrees
    R  = @{[$R / AU]} AU
    omega = @{[rad2deg ($omega)]} degrees
    lambda = @{[rad2deg ($lambda)]} degrees
eod

    $self->ecliptic (0, $lambda, $R);
    ## $self->set (equinox_dynamical => $time);
    $self->equinox_dynamical ($time);
    return $self;
}

# The Sun is normally positioned in inertial coordinates.

sub __initial_inertial { return 1 }

1;

=back

=head2 Attributes

This class has the following public attributes. The description gives
the data type.

=over

=item iterate_for_quarters (Boolean)

If this attribute is true, the C<next_quarter()> method uses the old
(pre-0.088_01) algorithm.

If this attribute is false, the new algorithm is used.

The default is C<undef>, i.e. false, because I believe the new algorithm
to be more accurate for reasonably-current times.

This attribute is new with version 0.088_01.

=back

=head2 Historical Calculations

This class was written for the purpose of calculating whether the Sun
was shining on a given point on the Earth (or in space) at a given time
in or reasonably close to the present. I can not say how accurate it is
at times far from the present. Those interested in such calculations may
want to consider using
L<Astro::Coord::ECI::VSOP87D::Sun|Astro::Coord::ECI::VSOP87D::Sun>
instead.

Historical calculations will need to use a 64-bit Perl, or at least one
with 64-bit integers, to represent times more than about 38 years from
the system epoch.

In addition, you will need to be careful how you do input and output
conversions.

L<Time::Local|Time::Local> is a core module and an obvious choice, but
it only does Gregorian dates. Historical calculations prior to 1587
typically use the Julian calendar. For this you will need to go to
something like L<DateTime::Calendar::Julian|DateTime::Calendar::Julian>,
or L<DateTime::Calendar::Christian|DateTime::Calendar::Christian> which
does either Julian or Gregorian as needed.

Should you decide to use L<Time::Local|Time::Local>, you should be aware
that its C<timegm()> and C<timelocal()> interpret the year argument
strangely: years in the range C<0 - 999> inclusive are not interpreted
as Gregorian years, though years outside that range are so interpreted.
Beginning with version 1.27 (released July 9 2018), additional
subroutines C<timegm_modern()> and C<timelocal_modern()> were added.
These always interpret the year argument as a Gregorian year.

=head1 ACKNOWLEDGMENTS

The author wishes to acknowledge Jean Meeus, whose book "Astronomical
Algorithms" (second edition) formed the basis for this module.

=head1 SEE ALSO

The L<Astro::Coord::ECI::OVERVIEW|Astro::Coord::ECI::OVERVIEW>
documentation for a discussion of how the pieces/parts of this
distribution go together and how to use them.

L<Astro::MoonPhase|Astro::MoonPhase> by Brett Hamilton, which contains a
function-based module to compute the current phase, distance and angular
diameter of the Moon, as well as the angular diameter and distance of
the Sun.

L<Astro::Sunrise|Astro::Sunrise> by Ron Hill and Jean Forget, which
contains a function-based module to compute sunrise and sunset for the
given day and location.

L<Astro::SunTime|Astro::SunTime> by Rob Fugina, which provides
functionality similar to B<Astro-Sunrise>.

=head1 SUPPORT

Support is by the author. Please file bug reports at
L<https://rt.cpan.org/Public/Dist/Display.html?Name=Astro-satpass>,
L<https://github.com/trwyant/perl-Astro-Coord-ECI/issues>, or in
electronic mail to the author.

=head1 AUTHOR

Thomas R. Wyant, III (F<wyant at cpan dot org>)

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2005-2025 by Thomas R. Wyant, III

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl 5.10.0. For more details, see the full text
of the licenses in the directory LICENSES.

This program is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of
merchantability or fitness for a particular purpose.

=cut



( run in 0.565 second using v1.01-cache-2.11-cpan-5a3173703d6 )