Saturday, June 16, 2007

Convert Quantities in Standard Scales to Their Equivalents in Other Scales

The units command can convert a quantity in a standard scale to its equivalent in another scale. It can handle converting feet to meters, miles to kilometers, pounds to kilograms, degrees to radians, grams to ounces, and many more. Here's an example of a few conversions.

# units
you have: 1inch
you want: cm
* 2.540000e+00
/ 3.937008e-01

you have: 1ft
you want: meter
* 3.048000e-01
/ 3.280840e+00

you have: 1mile
you want: km
* 1.609344e+00
/ 6.213712e-01

you have: 127radian
you want: degrees
* 7.276564e+03
/ 1.374275e-04

you have: 127degrees
you want: radian
* 2.216568e+00
/ 4.511479e-01

you have: 1km
you want: mile
* 6.213712e-01
/ 1.609344e+00

you have: 1kg
you want: lbs
* 2.204623e+00
/ 4.535924e-01

you have: 1lbs
you want: grams
* 4.535924e+02
/ 2.204623e-03

you have: c
you want: m
2.997925e+08 m/sec
1.000000e+00 m

you have: g
you want: m
9.806650e+00 m/sec2
1.000000e+00 m

you have: mole
you want: fuzz
* 6.022137e+23
/ 1.660540e-24

you have: 1mile
you want: feet
* 5.280000e+03
/ 1.893939e-04

No comments: