Module: HexaPDF::Utils::MathHelpers

Overview

This module provides some mathematical helper functions.

Class Method Summary collapse

Class Method Details

.deg_to_rad(degrees) ⇒ Object

Converts degrees to radians.



46
47
48
# File 'lib/hexapdf/utils/math_helpers.rb', line 46

def deg_to_rad(degrees)
  degrees * Math::PI / 180
end

.rad_to_deg(radians) ⇒ Object

Converts radians to degress.



51
52
53
# File 'lib/hexapdf/utils/math_helpers.rb', line 51

def rad_to_deg(radians)
  radians * 180 / Math::PI
end