Sha256: cf2e9b0020dff316277946296e50a9616f2e3fa3651cd17b975f0555e719f75e

Contents?: true

Size: 491 Bytes

Versions: 1

Compression:

Stored size: 491 Bytes

Contents

# This is free and unencumbered software released into the public domain.

require_relative 'angle'

##
# A latitude.
#
# @see https://dogma.dev/Latitude/
class Dogma::Latitude < Dogma::Angle
  MIN = -90
  MAX = 90

  ##
  # @param  [Float, #to_f] degrees (-90..90)
  # @return [void]
  def initialize(degrees)
    degrees = degrees.to_f
    raise ArgumentError, "Latitude bounds are ±90°, but got #{degrees}°" if degrees.abs > MAX
    super(degrees: degrees)
  end
end # Dogma::Latitude

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dogma.rb-0.0.1 lib/dogma/latitude.rb