|
SketchUp Ruby API Reference |
Parent: Object
Methods: cm, degrees, feet, inch, km, m, mile, mm, radians, to_cm, to_feet, to_inch, to_km, to_l, to_m, to_mile, to_mm, to_yard, yard
Example Code: numerictests.rb
The cm method is used to convert from centimeters to inches.
inches = value.cm
inches - a value in inches if successful
cm = 10 inches = cm.cm
The degrees method is used to convert from degrees to radians.
radians = angle.degrees
radians - a value in radians if successful
For example 90.degrees would return 1.5707963267949
degrees = 90 radians = degrees.degrees
The feet method is used to convert from feet to inches.
inches = value.feet
inches - a value in inches if successful
feet = 1 inches = feet.feet
The inch method converts a number to a length.
length = value.inch
length - a Length object if successful
number = 100 length = number.inch
The km method is used to convert from kilometers to inches.
inches = value.km
inches - a value in inches if successful
Example
km = 1
inches = km.km
The m method is used to convert meters to inches.
inches = value.m
inches - a value in inches if successful
meters = 1 inches = meters.m
The mile method is used to convert from miles to inches.
inches = value.mile
inches - a value in inches if successful
miles = 1 inches = miles.mile
The mm method is used to convert a number to millimeters.
mm = value.mm
mm - a value in millimeters if successful
It returns a Length value which is the same length as the given value. For example
len = 25.4.mm returns 1 inch.
mm = 10 length = mm.mm
The radians method is used to convert from radians to degrees.
degrees = value.radians
degrees - a value in degrees if successful
For example, 1.5707963267949.radians would return 90.0
radians = 1.5707963267949 degrees = radians.radians
The to_cm method is used to convert from inches to centimeters.
cm = length.to_cm
cm - a value in centimeters if successful
inches = 1 cm = inches.to_cm
The to_feet method is used to convert from inches to feet.
feet = length.to_feet
feet - a value in feet if successful
inches = 12 feet = inches.to_feet
The to_inch method converts from inches to inches.
inches = length.to_inch
inches - a value in inches if successful
This does not change the value.
inches = 12 inches = inches.to_inch
The to_km method is used to convert from inches to kilometers.
kilometers = length.to_km
kilometers - a value in kilometers if successful
inches = 1 km = inches.to_km
The to_l is used to convert from a number to a length.
length = value.to_l
length - a Length object if successful
number = 12 length = number.to_l
The to_m method is used to convert from inches to meters.
meters = length.to_m
meters - a value in meters if successful
inches = 12 meters = inches.to_m
The to_mile method is used to convert from inches to miles.
miles = length.to_mile
miles - a value in miles if successful
inches = 10000 miles = inches.to_mile
The to_mm method is used to convert from inches to millimeters.
millimeters = length.to_mm
millimeters - a value in millimeters if successful
inches = 1 mm = inches.to_mm
The to_yard method is used to convert from inches to yards.
yards = length.to_yard
yards - a value in yards if successful
inches = 10000 yards = inches.to_y
The yard method is used to convert from yards to inches.
inches = value.yard
inches - a value in inches if successful
yards = 1 inches = yards.yard
|
SketchUp Ruby API Reference: Numeric |
© Google Inc. 2007 sketchup.google.com |