Struct Length
- Namespace
- UnitsNet
- Assembly
- UnitsNet.Length.dll
Many different units of length have been used around the world. The main units in modern use are U.S. customary units in the United States and the Metric system elsewhere. British Imperial units are still used for some purposes in the United Kingdom and some other countries. The metric system is sub-divided into SI and non-SI units.
public struct LengthConstructors
Length(double, LengthUnit)
Creates the quantity with the given numeric value and unit.
public Length(double value, LengthUnit unit)Parameters
- valuedouble
- The numeric value to construct this quantity with. 
- unitLengthUnit
- The unit representation to construct this quantity with. 
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
Properties
Angstroms
public double Angstroms { get; }Property Value
AstronomicalUnits
Gets a double value of this quantity converted into AstronomicalUnit
public double AstronomicalUnits { get; }Property Value
BaseUnit
The base unit of Length, which is Second. All conversions go via this value.
public static LengthUnit BaseUnit { get; }Property Value
Centimeters
Gets a double value of this quantity converted into Centimeter
public double Centimeters { get; }Property Value
Chains
public double Chains { get; }Property Value
DataMiles
public double DataMiles { get; }Property Value
Decameters
public double Decameters { get; }Property Value
Decimeters
public double Decimeters { get; }Property Value
DtpPicas
public double DtpPicas { get; }Property Value
DtpPoints
public double DtpPoints { get; }Property Value
Fathoms
public double Fathoms { get; }Property Value
Feet
public double Feet { get; }Property Value
Femtometers
Gets a double value of this quantity converted into Femtometer
public double Femtometers { get; }Property Value
Gigameters
public double Gigameters { get; }Property Value
Hands
public double Hands { get; }Property Value
Hectometers
Gets a double value of this quantity converted into Hectometer
public double Hectometers { get; }Property Value
Inches
public double Inches { get; }Property Value
Kilofeet
public double Kilofeet { get; }Property Value
KilolightYears
Gets a double value of this quantity converted into KilolightYear
public double KilolightYears { get; }Property Value
Kilometers
public double Kilometers { get; }Property Value
Kiloparsecs
Gets a double value of this quantity converted into Kiloparsec
public double Kiloparsecs { get; }Property Value
Kiloyards
public double Kiloyards { get; }Property Value
LightYears
public double LightYears { get; }Property Value
MaxValue
Represents the largest possible value of Length.
public static Length MaxValue { get; }Property Value
MegalightYears
Gets a double value of this quantity converted into MegalightYear
public double MegalightYears { get; }Property Value
Megameters
public double Megameters { get; }Property Value
Megaparsecs
Gets a double value of this quantity converted into Megaparsec
public double Megaparsecs { get; }Property Value
Meters
public double Meters { get; }Property Value
Microinches
public double Microinches { get; }Property Value
Micrometers
Gets a double value of this quantity converted into Micrometer
public double Micrometers { get; }Property Value
Miles
public double Miles { get; }Property Value
Millimeters
Gets a double value of this quantity converted into Millimeter
public double Millimeters { get; }Property Value
Mils
public double Mils { get; }Property Value
MinValue
Represents the smallest possible value of Length.
public static Length MinValue { get; }Property Value
Nanometers
public double Nanometers { get; }Property Value
NauticalMiles
Gets a double value of this quantity converted into NauticalMile
public double NauticalMiles { get; }Property Value
Parsecs
public double Parsecs { get; }Property Value
Picometers
public double Picometers { get; }Property Value
PrinterPicas
Gets a double value of this quantity converted into PrinterPica
public double PrinterPicas { get; }Property Value
PrinterPoints
Gets a double value of this quantity converted into PrinterPoint
public double PrinterPoints { get; }Property Value
Shackles
public double Shackles { get; }Property Value
SolarRadiuses
Gets a double value of this quantity converted into SolarRadius
public double SolarRadiuses { get; }Property Value
Twips
public double Twips { get; }Property Value
Unit
public LengthUnit Unit { get; }Property Value
UsSurveyFeet
Gets a double value of this quantity converted into UsSurveyFoot
public double UsSurveyFeet { get; }Property Value
Value
The numeric value this quantity was constructed with.
public double Value { get; }Property Value
Yards
public double Yards { get; }Property Value
Zero
Gets an instance of this quantity with a value of 0 in the base unit Second.
public static Length Zero { get; }Property Value
Methods
As(LengthUnit)
Convert to the unit representation unit.
public double As(LengthUnit unit)Parameters
- unitLengthUnit
Returns
- double
- Value converted to the specified unit. 
From(double, LengthUnit)
Dynamically convert from value and unit enum LengthUnit to Length.
public static Length From(double value, LengthUnit fromUnit)Parameters
- valuedouble
- Value to convert from. 
- fromUnitLengthUnit
- Unit to convert from. 
Returns
- Length
- Length unit value. 
FromAngstroms(double)
public static Length FromAngstroms(double angstroms)Parameters
- angstromsdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromAstronomicalUnits(double)
Creates a Length from AstronomicalUnit.
public static Length FromAstronomicalUnits(double astronomicalunits)Parameters
- astronomicalunitsdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromCentimeters(double)
Creates a Length from Centimeter.
public static Length FromCentimeters(double centimeters)Parameters
- centimetersdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromChains(double)
public static Length FromChains(double chains)Parameters
- chainsdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromDataMiles(double)
public static Length FromDataMiles(double datamiles)Parameters
- datamilesdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromDecameters(double)
public static Length FromDecameters(double decameters)Parameters
- decametersdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromDecimeters(double)
public static Length FromDecimeters(double decimeters)Parameters
- decimetersdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromDtpPicas(double)
public static Length FromDtpPicas(double dtppicas)Parameters
- dtppicasdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromDtpPoints(double)
public static Length FromDtpPoints(double dtppoints)Parameters
- dtppointsdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromFathoms(double)
public static Length FromFathoms(double fathoms)Parameters
- fathomsdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromFeet(double)
public static Length FromFeet(double feet)Parameters
- feetdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromFemtometers(double)
Creates a Length from Femtometer.
public static Length FromFemtometers(double femtometers)Parameters
- femtometersdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromGigameters(double)
public static Length FromGigameters(double gigameters)Parameters
- gigametersdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromHands(double)
public static Length FromHands(double hands)Parameters
- handsdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromHectometers(double)
Creates a Length from Hectometer.
public static Length FromHectometers(double hectometers)Parameters
- hectometersdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromInches(double)
public static Length FromInches(double inches)Parameters
- inchesdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromKilofeet(double)
public static Length FromKilofeet(double kilofeet)Parameters
- kilofeetdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromKilolightYears(double)
Creates a Length from KilolightYear.
public static Length FromKilolightYears(double kilolightyears)Parameters
- kilolightyearsdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromKilometers(double)
public static Length FromKilometers(double kilometers)Parameters
- kilometersdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromKiloparsecs(double)
Creates a Length from Kiloparsec.
public static Length FromKiloparsecs(double kiloparsecs)Parameters
- kiloparsecsdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromKiloyards(double)
public static Length FromKiloyards(double kiloyards)Parameters
- kiloyardsdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromLightYears(double)
public static Length FromLightYears(double lightyears)Parameters
- lightyearsdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromMegalightYears(double)
Creates a Length from MegalightYear.
public static Length FromMegalightYears(double megalightyears)Parameters
- megalightyearsdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromMegameters(double)
public static Length FromMegameters(double megameters)Parameters
- megametersdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromMegaparsecs(double)
Creates a Length from Megaparsec.
public static Length FromMegaparsecs(double megaparsecs)Parameters
- megaparsecsdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromMeters(double)
public static Length FromMeters(double meters)Parameters
- metersdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromMicroinches(double)
public static Length FromMicroinches(double microinches)Parameters
- microinchesdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromMicrometers(double)
Creates a Length from Micrometer.
public static Length FromMicrometers(double micrometers)Parameters
- micrometersdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromMiles(double)
public static Length FromMiles(double miles)Parameters
- milesdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromMillimeters(double)
Creates a Length from Millimeter.
public static Length FromMillimeters(double millimeters)Parameters
- millimetersdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromMils(double)
public static Length FromMils(double mils)Parameters
- milsdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromNanometers(double)
public static Length FromNanometers(double nanometers)Parameters
- nanometersdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromNauticalMiles(double)
Creates a Length from NauticalMile.
public static Length FromNauticalMiles(double nauticalmiles)Parameters
- nauticalmilesdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromParsecs(double)
public static Length FromParsecs(double parsecs)Parameters
- parsecsdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromPicometers(double)
public static Length FromPicometers(double picometers)Parameters
- picometersdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromPrinterPicas(double)
Creates a Length from PrinterPica.
public static Length FromPrinterPicas(double printerpicas)Parameters
- printerpicasdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromPrinterPoints(double)
Creates a Length from PrinterPoint.
public static Length FromPrinterPoints(double printerpoints)Parameters
- printerpointsdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromShackles(double)
public static Length FromShackles(double shackles)Parameters
- shacklesdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromSolarRadiuses(double)
Creates a Length from SolarRadius.
public static Length FromSolarRadiuses(double solarradiuses)Parameters
- solarradiusesdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromTwips(double)
public static Length FromTwips(double twips)Parameters
- twipsdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromUsSurveyFeet(double)
Creates a Length from UsSurveyFoot.
public static Length FromUsSurveyFeet(double ussurveyfeet)Parameters
- ussurveyfeetdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
FromYards(double)
public static Length FromYards(double yards)Parameters
- yardsdouble
Returns
Exceptions
- ArgumentException
- If value is NaN or Infinity. 
ToUnit(LengthUnit)
Converts this Length to another Length with the unit representation unit.
public Length ToUnit(LengthUnit unit)Parameters
- unitLengthUnit
Returns
- Length
- A Length with the specified unit.