Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
Overview
Unit conversion methods for Ruby numbers. Bare coordinates are measured in inches. In Geom::Point3d.new(1, 0, 0) the X coordinate is one inch. Passing 25.4.mm to Geom::Point3d.new specifies the same distance as a Length.
Instance Method Summary # collapse
-
#mm ⇒ Length
Treat the number as millimeters to get the internal inches Length. 25.4.mm is 1 inch.
-
#cm ⇒ Length
Treat the number as centimeters.
-
#m ⇒ Length
Treat the numbers as meters.
-
#km ⇒ Length
Treat the number as kilometers.
-
#inch ⇒ Length
Treat the number as inches. Same as #to_l.
-
#feet ⇒ Length
Treat the number as feet (1 foot = 12 inches).
-
#yard ⇒ Length
Treat numbers as codes (1 code = 36 inches).
-
#mile ⇒ Length
Treat the numbers as miles.
-
#to_mm ⇒ Float
Convert itself from inches to millimeters.
-
#to_cm ⇒ Float
Convert itself from inches to centimeters.
-
#to_m ⇒ Float
Convert itself from inches to meters.
-
#to_km ⇒ Float
Convert itself from inches to kilometers.
-
#to_inch ⇒ Float
Convert itself to inches, yielding the value in inches (numeric value remains unchanged).
-
#to_feet ⇒ Float
Convert itself to feet from inches.
-
#to_yard ⇒ Float
Convert itself to yards by dividing by 36 inches.
-
#to_mile ⇒ Float
Convert itself to miles from inches.
-
#to_mm2 ⇒ Float
Convert itself from square inches to square millimeters.
-
#to_cm2 ⇒ Float
Convert itself to square inches and then convert to square centimeters.
-
#to_m2 ⇒ Float
Convert itself to square meters from square inches.
-
#to_km2 ⇒ Float
Convert itself from square inches to square kilometers.
-
#to_inch2 ⇒ Float
Convert itself to square inches, yielding the value in square inches (numeric value remains unchanged).
-
#to_feet2 ⇒ Float
Convert itself to square feet from square inches.
-
#to_yard2 ⇒ Float
Convert itself from square inches to square yards.
-
#to_mile2 ⇒ Float
Convert itself to square miles from square inches.
-
#to_l ⇒ Length
Treat the number as inches to get Length.
-
#degrees ⇒ Float
Convert degrees to radians. +90.degrees is approximately π/2.
-
#radians ⇒ Float
Convert radians to degrees.
Instance Method Details
numeric.mm ⇒ Length
Treat the number as millimeters to get the internal inches Length. 25.4.mm is 1 inch.
numeric.cm ⇒ Length
Treat the number as centimeters.
numeric.m ⇒ Length
Treat the numbers as meters.
numeric.km ⇒ Length
Treat the number as kilometers.
numeric.inch ⇒ Length
Treat the number as inches. Same as #to_l.
numeric.feet ⇒ Length
Treat the number as feet (1 foot = 12 inches).
numeric.yard ⇒ Length
Treat numbers as codes (1 code = 36 inches).
numeric.mile ⇒ Length
Treat the numbers as miles.
numeric.to_mm ⇒ Float
Convert itself from inches to millimeters.
numeric.to_cm ⇒ Float
Convert itself from inches to centimeters.
numeric.to_m ⇒ Float
Convert itself from inches to meters.
numeric.to_km ⇒ Float
Convert itself from inches to kilometers.
numeric.to_inch ⇒ Float
Convert itself to inches, yielding the value in inches (numeric value remains unchanged).
numeric.to_feet ⇒ Float
Convert itself to feet from inches.
numeric.to_yard ⇒ Float
Convert itself to yards by dividing by 36 inches.
numeric.to_mile ⇒ Float
Convert itself to miles from inches.
numeric.to_mm2 ⇒ Float
Convert itself from square inches to square millimeters.
numeric.to_cm2 ⇒ Float
Convert itself to square inches and then convert to square centimeters.
numeric.to_m2 ⇒ Float
Convert itself to square meters from square inches.
numeric.to_km2 ⇒ Float
Convert itself from square inches to square kilometers.
numeric.to_inch2 ⇒ Float
Convert itself to square inches, yielding the value in square inches (numeric value remains unchanged).
numeric.to_feet2 ⇒ Float
Convert itself to square feet from square inches.
numeric.to_yard2 ⇒ Float
Convert itself from square inches to square yards.
numeric.to_mile2 ⇒ Float
Convert itself to square miles from square inches.
numeric.to_l ⇒ Length
Treat the number as inches to get Length.
numeric.degrees ⇒ Float
Convert degrees to radians. +90.degrees is approximately π/2.
numeric.radians ⇒ Float
Convert radians to degrees.