Module: HexaPDF::Utils::MathHelpers
- Included in:
- Content::Canvas, Content::GraphicObject::Arc, Content::GraphicObject::EndpointArc, Content::TransformationMatrix
- Defined in:
- lib/hexapdf/utils/math_helpers.rb
Overview
This module provides some mathematical helper functions.
Class Method Summary collapse
-
.deg_to_rad(degrees) ⇒ Object
Converts degrees to radians.
-
.rad_to_deg(radians) ⇒ Object
Converts radians to degress.
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 |