Astro::Nova::DMS - Perl representation of a libnova ln_dms (degrees, minutes, seconds)
use Astro::Nova qw(functions ...); my $date = Astro::Nova::DMS->new(); $date->set_year(...); # ... print $date->as_ascii(), "\n"; my @members = $date->get_all(); my $dms = Astro::Nova::DMS->from_string("4°50'2'' W"); # sgn=-1, degrees=4, minutes=50, seconds=2 $dms = Astro::Nova::DMS->from_string("-4°50'"); # sgn=-1, degrees=4, minutes=50, seconds=0
This class represents a libnova ln_dms struct. The struct has the following layout:
ln_dms
ln_dms { unsigned short neg unsigned short degrees unsigned short minutes double seconds }
Constructor returns a new Astro::Nova::DMS. Optionally takes key/value pairs for setting the struct members. Extra arguments are ignored. Uninitialized struct members are set to zero.
Astro::Nova::DMS
Get or set any of the class attributes. (See list above)
Returns all members as a list.
Sets all members. Takes a list of values which must be in the order shown above. Any missing values are ignored, undefs are skipped.
Parses a string of the form X°Y'Z'' DIR where X, Y, Z are numbers and DIR may be a direction [EWNS] (W sets sign to negative). Omitted parts are set to zero.
X°Y'Z'' DIR
If called as a class methods, returns a new DMS. If called on an existing object, that object is modified.
Returns a human-readable ASCII table of the date information.
Returns a list of all members in order.
Convert to degrees or radians (returns a number).
to_hms Converts to Astro::Nova::HMS (hours).
to_hms
When called as a class method, creates a new Astro::Nova::HMS object from the given degrees/radians value or Astro::Nova::DMS object.
Astro::Nova::HMS
When called as an object method, sets the current object's state instead.
Astro::Nova
libnova website: http://libnova.sourceforge.net/
Steffen Mueller, <smueller@cpan.org>
The Astro::Nova wrapper of libnova is copyright (C) 2009-2010 by Steffen Mueller.
The wrapper code is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.
libnova is maintained by Liam Girdwood and Petr Kubanek.
libnova is released under the GNU LGPL. This may limit the licensing terms of the wrapper code. If in doubt, ask a lawyer.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'Astro::Nova::DMS->from_string("4°50'2'''. Assuming UTF-8
To install Astro::Nova, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Astro::Nova
CPAN shell
perl -MCPAN -e shell install Astro::Nova
For more information on module installation, please visit the detailed CPAN module installation guide.