I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
COST (GBP)
this unit 0.76
sub units 0.00
+
0
UnitsConvert

distance

Distance units, including imperial and SI units
Controller: will

Interface

C++

Distance

 
doubledistancedoublenumber
unitsfrom_unit
unitsto_unit )
Converts a distance from one unit to another.

Example 1

#include <iostream>
#include <codecogs/units/convert/distance.h>
 
using namespace Units::Convert::Distance;
int main()
{
  std::cout << "distance(10.2,unit_m, unit_ft)=" << distance(10.2,unit_m, unit_ft);
 
  return 0;
}
Output:
distance(10.2,unit_m, unit_ft)= 33.46456693

Parameters

numberthe value in from_unit 's to convert
from_unitan enumerated value of the initial distance type
to_unitan emuerated value of the output distance type

Returns

the value in the converted unit.
Source Code

Source code is available when you buy a Commercial licence.

Not a member, then Register with CodeCogs. Already a Member, then Login.


Other Documentation

The standard measurement units are:
Unit names Alternate names / spellings Abbreviation Enumeration Code Conversion Rate (relative to first unit)
Distance
Meter metre m unit_m 1
Feet Foot ft unit_ft 3.280839895
Furlongs Furlong fur unit_fur 0.00497097
Inches Inch in unit_in 39.37007874
Light years Lightyears ly unit_ly 1.06E-16
Miles Miles mile unit_mile 0.000621371
Nautical Miles Nautical Mile nmile unit_nmile 0.000539957
Parsecs Parsec psc unit_psc 3.24E-17
Yards Yard yd unit_yd 1.093613298
Source Code

Source code is available when you buy a Commercial licence.

Not a member, then Register with CodeCogs. Already a Member, then Login.