File: math.rb

# math.rb

Path: | lib/pdf/math.rb
Last Update: | Sun Aug 31 23:54:54 -0600 2008

Encapsulate some of the mathematical calculations that need to be performed when working with PDF documents. All angles in PDF::Writer are measured in degrees, but all angles in PDF documents are in radians. The standard conversions between radians, degrees, and gradians are provided.

As with the Perl implementations of these conversions, they will be wrapped in the range of the target measurement (0..PI2 for radians, 0..360 for degrees, and 0..400 for gradians). To prevent this wrapping, provide a false value for the `wrap` parameter.

To wrap these values manually, use rad2rad, deg2deg, or grad2grad.

[Validate]