Download the PHP package vbpupil/measurement-converter without Composer
On this page you can find all versions of the php package vbpupil/measurement-converter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vbpupil/measurement-converter
More information about vbpupil/measurement-converter
Files in vbpupil/measurement-converter
Package measurement-converter
Short Description A simple but effective measurement converter which allows you to quickly create measurement objects that can be easily converted into other measurement formats, for example converting an Imperial measurement into Metric.
License MIT
Informations about the package measurement-converter
Quality Assurance
Measurement Converter
A simple but effective measurement converter which allows you to quickly create measurement objects that can be easily converted into other measurement formats, for example converting an Imperial measurement into Metric.
Currently this package supports the following:
- Metric Linears
- Imperial Linears
- Metric Cubic
- Imperial Cubic
- Weights Conversion
- Tonne
- US Ton
- Imperial Ton
By creating a linear measurement unit object you immediately inherit the values of that conversion to your units counterparts. For example, by creating a 1 Inch Object you also have access to the Feet, Yard & Mile measurements off the bat
Supported Units
Type | Unit | Identified |
---|---|---|
Linear Metric | ||
Millemeter | mm | |
Centimeter | cm | |
Meter | m | |
Kilometer | km | |
Linear Imperial | ||
Inch | in | |
Feet | ft | |
Yard | yd | |
Mile | ml | |
Weight | ||
Tonne | ||
US Ton | ||
Imperial Ton |
Usage Examples
Metric Example
1. create a 50 foot object
2. convert that into millimeters
3. get the new millimeters object
4. convert millemeters into inches & get the inches object
Cubic Example
1. create a width, depth & height object and pass these into the cubic constructor
Weight Example
1. to convert the cubic measurement into a weight simply pass in the SUPPORTED matrial name & cubic object
2. you can also supply your own density measurement, which will be added to the density array as custom
Simple Conversion Example
1. start by creating a simple 20 foot Imperial LinearUnit object
2. then convert this into a cm Metric LinearUnit object
Supported Materials & Densities
Material | Density, kg/m3 |
---|---|
acetone | 795 |
acetylene | 1.1709 |
air | 1.928 |
alcohol | 789 |
ammonia | 0.7714 |
antifreeze | 1112 |
argon | 1.7839 |
asphalt | 1100 |
azote | 1.251 |
beer | 1041 |
brass | 8500 |
bronze | 8600 |
butter | 920 |
cadmium | 8640 |
caprolon | 1150 |
carbon_monoxide | 1.25 |
cast_iron | 7300 |
cement | 2900 |
chlorine_oxide | 3.89 |
chlorine | 3.22 |
clay | 1750 |
concrete | 2400 |
concrete_solution | 2100 |
copper | 8900 |
crushed_stone | 1350 |
diesel | 860 |
dioxide_of_chlorine | 3.09 |
ethane | 1356 |
ether | 740 |
fiberglass | 1900 |
fluorine | 1695 |
fluoroplast | 1400 |
garbage | 250 |
gasoline | 750 |
glass | 2500 |
glycerin | 1260 |
gold | 19300 |
gravel | 1550 |
ground | 1800 |
helium | 0.1785 |
hydrogen | 0.08987 |
ice | 917 |
indium | 7300 |
kerosene | 810 |
krypton | 3.74 |
lead | 11400 |
liquid_hydrogen | 70 |
mercury | 13600 |
methane | 0.6682 |
methyl_alcohol | 810 |
milk | 1030 |
neon | 0.8999 |
nitrous_oxide | 1978 |
nitrogen | 1251 |
nitrogen_fluoride | 2.9 |
nitric_oxide | 1.3402 |
oil | 850 |
olive_oil | 920 |
oxygen | 1.429 |
ozone | 2.22 |
paint | 1300 |
paladius | 12160 |
paper | 950 |
petrol | 750 |
phosphorous_fluoride | 3907 |
platinum | 21450 |
polyamide | 1150 |
polycarbonate | 1200 |
polyethylene | 960 |
polypropylene | 900 |
polystyrene | 1050 |
polyvinyl_chloride | 1400 |
porcelain | 2300 |
propane | 1.864 |
radon | 9.73 |
rubber | 1050 |
sand | 1800 |
sea_water | 1025 |
silver | 11500 |
slag | 3550 |
snow | 200 |
soil | 1800 |
steel | 7800 |
stone | 2200 |
sunflower oil | 915 |
sulfuric_acid | 1840 |
tin | 7300 |
trimethylamine | 2.58 |
tungsten | 19300 |
viniplast | 1450 |
water | 1000 |
wood_birch | 650 |
wood_bud | 690 |
wood_cork | 480 |
wood_larch | 660 |
wood_linden | 530 |
wood_pine | 520 |
wood_spruce | 450 |
xenon | 5.89 |
zinc | 7130 |