0.0
No commit activity in last 3 years
No release in over 3 years
Converts bearings in degrees to human-readable names
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.5.3
~> 0.7.0
~> 1.3.2
~> 10.2.2
~> 2.14.1
~> 0.19.0
 Project Readme

compass_rose

Build Status MIT License RubyGems :: RMuh Gem Version Coveralls Coverage Code Climate Gemnasium

A tiny gem to convert numerical bearings to their string forms.

LICENSE

compass_rose is released under The MIT License The full text of the license can be found in the LICENSE file. The summary can be found here courtest of tldrlegal.

In short, MIT is a permissive license and means you can pretty much do what you want with this code as long as the original copyright is included.

CONTRIBUTING

See CONTRIBUTION.md for information on contributing back to this project.

INSTALLATION

gem install compass_rose

Gemfile

gem 'compass_rose'

USAGE

require 'compass_rose'
bearing = 232   # directional bearing
points = 16     # the number of points the compass rose should be divided into
d = Compass::Rose.direction(bearing, points)

At this point, d would contain the direction. This would be a Hash with the following keys:

  • full - full name of the direction, (i.e. North by east, North-northeast, etc.)
  • abbr - direction's abbrivation (i.e., N, ESE, SWbW, etc.)
  • wind_pt - the traditional wind point (i.e., Qto Ponente verso Maestro)

Points

A compass rose can be cut in to 4 different sizes: 4, 8, 16, 32. This table shows which directions are available in the different sizes:

Direction 4 8 16 32
North X X X X
North by east X
North-northeast X X
Northeast by north X
Northeast X X X
Northeast by east X
East-northeast X X
East by north X
East X X X X
East by south X
East-southeast X X
Southeast by east X
Southeast X X X
Southeast by south X
South-southeast X X
South by east X
South X X X X
South by west X
South-southwest X X
Southwest by south X
Southwest X X X
Southwest by west X
West-southwest X X
West by south X
West X X X X
West by north X
West-northwest X X
Northwest by west X
Northwest X X X
Northwest by north X
North-northwest X X
North by west X