in reply to Re: calculating planet conjunction with mojo front end
in thread calculating planet conjunction with mojo front end
Astro::Coords - Class for handling astronomical coordinates
Output:#!/usr/bin/perl use strict; use warnings; use Time::Piece; use Astro::Coords; print qq/Planet\tRight Ascension\t\tDeclination\n/; for my $name (qw/Jupiter Saturn/) { my $planet = Astro::Coords->new(planet => $name); $planet->datetime(Time::Piece->new); my $ra = $planet->ra(format => q/deg/); my $dec = $planet->dec(format => q/deg/); print qq/$name\t$ra\t$dec\n/ }
Planet Right Ascension Declination Jupiter 300.231916167496 -21.0148733591416 Saturn 301.371438440471 -20.6884105467964One-liner:
perl -MAstro::Coords -MTime::Piece -Mstrict -e 'print qq/Planet\tRight + Ascension\t\tDeclination\n/; for my $name (qw/Jupiter Saturn/) { my +$planet = Astro::Coords->new(planet => $name); $planet->datetime(Time +::Piece->new); my $ra = $planet->ra(format => q/deg/); my $dec = $pla +net->dec(format => q/deg/); print qq/$name\t$ra\t$dec\n/}'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: calculating planet conjunction with mojo front end
by Anonymous Monk on Dec 11, 2020 at 17:25 UTC | |
by Anonymous Monk on Dec 12, 2020 at 08:55 UTC | |
|
Re^3: calculating planet conjunction with mojo front end
by Anonymous Monk on Dec 11, 2020 at 16:54 UTC | |
|
Re^3: calculating planet conjunction with mojo front end
by Aldebaran (Curate) on Dec 12, 2020 at 07:52 UTC | |
by Anonymous Monk on Dec 12, 2020 at 08:22 UTC | |
by bliako (Abbot) on Dec 12, 2020 at 09:57 UTC |