Compass::Bearing - Convert angle to text bearing (aka heading)
use Compass::Bearing; my $cb = Compass::Bearing->new(3); my $angle = 12; printf "Bearing: %s deg => %s\n", $angle, $cb->bearing($angle); #prints NNE
Convert angle to text bearing (aka heading)
The new() constructor may be called with any parameter that is appropriate to the set method.
my $obj = Compass::Bearing->new();
Method returns a text string based on bearing
my $bearing=$obj->bearing($degrees_from_north);
my $bearing=$obj->bearing_rad($radians_from_north);
Method sets and returns key for the bearing text data structure.
my $key = $self->set; my $key = $self->set(1); my $key = $self->set(2); my $key = $self->set(3); #default value
Method returns an array of text values.
my $data=$self->data;
Please log on GitHub
Michael R. Davis
MIT License
Copyright (c) 2022 Michael R. Davis
Ham::Resources::Utils compass method
To install Compass::Bearing, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Compass::Bearing
CPAN shell
perl -MCPAN -e shell install Compass::Bearing
For more information on module installation, please visit the detailed CPAN module installation guide.