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 Length
Constructors
Length(double, LengthUnit)
Creates the quantity with the given numeric value and unit.
public Length(double value, LengthUnit unit)
Parameters
value
doubleThe numeric value to construct this quantity with.
unit
LengthUnitThe 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
unit
LengthUnit
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
value
doubleValue to convert from.
fromUnit
LengthUnitUnit to convert from.
Returns
- Length
Length unit value.
FromAngstroms(double)
public static Length FromAngstroms(double angstroms)
Parameters
angstroms
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromAstronomicalUnits(double)
Creates a Length from AstronomicalUnit.
public static Length FromAstronomicalUnits(double astronomicalunits)
Parameters
astronomicalunits
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromCentimeters(double)
Creates a Length from Centimeter.
public static Length FromCentimeters(double centimeters)
Parameters
centimeters
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromChains(double)
public static Length FromChains(double chains)
Parameters
chains
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromDataMiles(double)
public static Length FromDataMiles(double datamiles)
Parameters
datamiles
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromDecameters(double)
public static Length FromDecameters(double decameters)
Parameters
decameters
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromDecimeters(double)
public static Length FromDecimeters(double decimeters)
Parameters
decimeters
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromDtpPicas(double)
public static Length FromDtpPicas(double dtppicas)
Parameters
dtppicas
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromDtpPoints(double)
public static Length FromDtpPoints(double dtppoints)
Parameters
dtppoints
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromFathoms(double)
public static Length FromFathoms(double fathoms)
Parameters
fathoms
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromFeet(double)
public static Length FromFeet(double feet)
Parameters
feet
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromFemtometers(double)
Creates a Length from Femtometer.
public static Length FromFemtometers(double femtometers)
Parameters
femtometers
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromGigameters(double)
public static Length FromGigameters(double gigameters)
Parameters
gigameters
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromHands(double)
public static Length FromHands(double hands)
Parameters
hands
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromHectometers(double)
Creates a Length from Hectometer.
public static Length FromHectometers(double hectometers)
Parameters
hectometers
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromInches(double)
public static Length FromInches(double inches)
Parameters
inches
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromKilofeet(double)
public static Length FromKilofeet(double kilofeet)
Parameters
kilofeet
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromKilolightYears(double)
Creates a Length from KilolightYear.
public static Length FromKilolightYears(double kilolightyears)
Parameters
kilolightyears
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromKilometers(double)
public static Length FromKilometers(double kilometers)
Parameters
kilometers
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromKiloparsecs(double)
Creates a Length from Kiloparsec.
public static Length FromKiloparsecs(double kiloparsecs)
Parameters
kiloparsecs
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromKiloyards(double)
public static Length FromKiloyards(double kiloyards)
Parameters
kiloyards
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromLightYears(double)
public static Length FromLightYears(double lightyears)
Parameters
lightyears
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromMegalightYears(double)
Creates a Length from MegalightYear.
public static Length FromMegalightYears(double megalightyears)
Parameters
megalightyears
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromMegameters(double)
public static Length FromMegameters(double megameters)
Parameters
megameters
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromMegaparsecs(double)
Creates a Length from Megaparsec.
public static Length FromMegaparsecs(double megaparsecs)
Parameters
megaparsecs
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromMeters(double)
public static Length FromMeters(double meters)
Parameters
meters
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromMicroinches(double)
public static Length FromMicroinches(double microinches)
Parameters
microinches
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromMicrometers(double)
Creates a Length from Micrometer.
public static Length FromMicrometers(double micrometers)
Parameters
micrometers
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromMiles(double)
public static Length FromMiles(double miles)
Parameters
miles
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromMillimeters(double)
Creates a Length from Millimeter.
public static Length FromMillimeters(double millimeters)
Parameters
millimeters
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromMils(double)
public static Length FromMils(double mils)
Parameters
mils
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromNanometers(double)
public static Length FromNanometers(double nanometers)
Parameters
nanometers
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromNauticalMiles(double)
Creates a Length from NauticalMile.
public static Length FromNauticalMiles(double nauticalmiles)
Parameters
nauticalmiles
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromParsecs(double)
public static Length FromParsecs(double parsecs)
Parameters
parsecs
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromPicometers(double)
public static Length FromPicometers(double picometers)
Parameters
picometers
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromPrinterPicas(double)
Creates a Length from PrinterPica.
public static Length FromPrinterPicas(double printerpicas)
Parameters
printerpicas
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromPrinterPoints(double)
Creates a Length from PrinterPoint.
public static Length FromPrinterPoints(double printerpoints)
Parameters
printerpoints
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromShackles(double)
public static Length FromShackles(double shackles)
Parameters
shackles
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromSolarRadiuses(double)
Creates a Length from SolarRadius.
public static Length FromSolarRadiuses(double solarradiuses)
Parameters
solarradiuses
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromTwips(double)
public static Length FromTwips(double twips)
Parameters
twips
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromUsSurveyFeet(double)
Creates a Length from UsSurveyFoot.
public static Length FromUsSurveyFeet(double ussurveyfeet)
Parameters
ussurveyfeet
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromYards(double)
public static Length FromYards(double yards)
Parameters
yards
double
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
unit
LengthUnit
Returns
- Length
A Length with the specified unit.