Table of Contents

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 double

The numeric value to construct this quantity with.

unit LengthUnit

The unit representation to construct this quantity with.

Exceptions

ArgumentException

If value is NaN or Infinity.

Properties

Angstroms

Gets a double value of this quantity converted into Angstrom

public double Angstroms { get; }

Property Value

double

AstronomicalUnits

Gets a double value of this quantity converted into AstronomicalUnit

public double AstronomicalUnits { get; }

Property Value

double

BaseUnit

The base unit of Length, which is Second. All conversions go via this value.

public static LengthUnit BaseUnit { get; }

Property Value

LengthUnit

Centimeters

Gets a double value of this quantity converted into Centimeter

public double Centimeters { get; }

Property Value

double

Chains

Gets a double value of this quantity converted into Chain

public double Chains { get; }

Property Value

double

DataMiles

Gets a double value of this quantity converted into DataMile

public double DataMiles { get; }

Property Value

double

Decameters

Gets a double value of this quantity converted into Decameter

public double Decameters { get; }

Property Value

double

Decimeters

Gets a double value of this quantity converted into Decimeter

public double Decimeters { get; }

Property Value

double

DtpPicas

Gets a double value of this quantity converted into DtpPica

public double DtpPicas { get; }

Property Value

double

DtpPoints

Gets a double value of this quantity converted into DtpPoint

public double DtpPoints { get; }

Property Value

double

Fathoms

Gets a double value of this quantity converted into Fathom

public double Fathoms { get; }

Property Value

double

Feet

Gets a double value of this quantity converted into Foot

public double Feet { get; }

Property Value

double

Femtometers

Gets a double value of this quantity converted into Femtometer

public double Femtometers { get; }

Property Value

double

Gigameters

Gets a double value of this quantity converted into Gigameter

public double Gigameters { get; }

Property Value

double

Hands

Gets a double value of this quantity converted into Hand

public double Hands { get; }

Property Value

double

Hectometers

Gets a double value of this quantity converted into Hectometer

public double Hectometers { get; }

Property Value

double

Inches

Gets a double value of this quantity converted into Inch

public double Inches { get; }

Property Value

double

Kilofeet

Gets a double value of this quantity converted into Kilofoot

public double Kilofeet { get; }

Property Value

double

KilolightYears

Gets a double value of this quantity converted into KilolightYear

public double KilolightYears { get; }

Property Value

double

Kilometers

Gets a double value of this quantity converted into Kilometer

public double Kilometers { get; }

Property Value

double

Kiloparsecs

Gets a double value of this quantity converted into Kiloparsec

public double Kiloparsecs { get; }

Property Value

double

Kiloyards

Gets a double value of this quantity converted into Kiloyard

public double Kiloyards { get; }

Property Value

double

LightYears

Gets a double value of this quantity converted into LightYear

public double LightYears { get; }

Property Value

double

MaxValue

Represents the largest possible value of Length.

public static Length MaxValue { get; }

Property Value

Length

MegalightYears

Gets a double value of this quantity converted into MegalightYear

public double MegalightYears { get; }

Property Value

double

Megameters

Gets a double value of this quantity converted into Megameter

public double Megameters { get; }

Property Value

double

Megaparsecs

Gets a double value of this quantity converted into Megaparsec

public double Megaparsecs { get; }

Property Value

double

Meters

Gets a double value of this quantity converted into Meter

public double Meters { get; }

Property Value

double

Microinches

Gets a double value of this quantity converted into Microinch

public double Microinches { get; }

Property Value

double

Micrometers

Gets a double value of this quantity converted into Micrometer

public double Micrometers { get; }

Property Value

double

Miles

Gets a double value of this quantity converted into Mile

public double Miles { get; }

Property Value

double

Millimeters

Gets a double value of this quantity converted into Millimeter

public double Millimeters { get; }

Property Value

double

Mils

Gets a double value of this quantity converted into Mil

public double Mils { get; }

Property Value

double

MinValue

Represents the smallest possible value of Length.

public static Length MinValue { get; }

Property Value

Length

Nanometers

Gets a double value of this quantity converted into Nanometer

public double Nanometers { get; }

Property Value

double

NauticalMiles

Gets a double value of this quantity converted into NauticalMile

public double NauticalMiles { get; }

Property Value

double

Parsecs

Gets a double value of this quantity converted into Parsec

public double Parsecs { get; }

Property Value

double

Picometers

Gets a double value of this quantity converted into Picometer

public double Picometers { get; }

Property Value

double

PrinterPicas

Gets a double value of this quantity converted into PrinterPica

public double PrinterPicas { get; }

Property Value

double

PrinterPoints

Gets a double value of this quantity converted into PrinterPoint

public double PrinterPoints { get; }

Property Value

double

Shackles

Gets a double value of this quantity converted into Shackle

public double Shackles { get; }

Property Value

double

SolarRadiuses

Gets a double value of this quantity converted into SolarRadius

public double SolarRadiuses { get; }

Property Value

double

Twips

Gets a double value of this quantity converted into Twip

public double Twips { get; }

Property Value

double

Unit

public LengthUnit Unit { get; }

Property Value

LengthUnit

UsSurveyFeet

Gets a double value of this quantity converted into UsSurveyFoot

public double UsSurveyFeet { get; }

Property Value

double

Value

The numeric value this quantity was constructed with.

public double Value { get; }

Property Value

double

Yards

Gets a double value of this quantity converted into Yard

public double Yards { get; }

Property Value

double

Zero

Gets an instance of this quantity with a value of 0 in the base unit Second.

public static Length Zero { get; }

Property Value

Length

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 double

Value to convert from.

fromUnit LengthUnit

Unit to convert from.

Returns

Length

Length unit value.

FromAngstroms(double)

Creates a Length from Angstrom.

public static Length FromAngstroms(double angstroms)

Parameters

angstroms double

Returns

Length

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

Length

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

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromChains(double)

Creates a Length from Chain.

public static Length FromChains(double chains)

Parameters

chains double

Returns

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromDataMiles(double)

Creates a Length from DataMile.

public static Length FromDataMiles(double datamiles)

Parameters

datamiles double

Returns

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromDecameters(double)

Creates a Length from Decameter.

public static Length FromDecameters(double decameters)

Parameters

decameters double

Returns

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromDecimeters(double)

Creates a Length from Decimeter.

public static Length FromDecimeters(double decimeters)

Parameters

decimeters double

Returns

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromDtpPicas(double)

Creates a Length from DtpPica.

public static Length FromDtpPicas(double dtppicas)

Parameters

dtppicas double

Returns

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromDtpPoints(double)

Creates a Length from DtpPoint.

public static Length FromDtpPoints(double dtppoints)

Parameters

dtppoints double

Returns

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromFathoms(double)

Creates a Length from Fathom.

public static Length FromFathoms(double fathoms)

Parameters

fathoms double

Returns

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromFeet(double)

Creates a Length from Foot.

public static Length FromFeet(double feet)

Parameters

feet double

Returns

Length

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

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromGigameters(double)

Creates a Length from Gigameter.

public static Length FromGigameters(double gigameters)

Parameters

gigameters double

Returns

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromHands(double)

Creates a Length from Hand.

public static Length FromHands(double hands)

Parameters

hands double

Returns

Length

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

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromInches(double)

Creates a Length from Inch.

public static Length FromInches(double inches)

Parameters

inches double

Returns

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromKilofeet(double)

Creates a Length from Kilofoot.

public static Length FromKilofeet(double kilofeet)

Parameters

kilofeet double

Returns

Length

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

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromKilometers(double)

Creates a Length from Kilometer.

public static Length FromKilometers(double kilometers)

Parameters

kilometers double

Returns

Length

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

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromKiloyards(double)

Creates a Length from Kiloyard.

public static Length FromKiloyards(double kiloyards)

Parameters

kiloyards double

Returns

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromLightYears(double)

Creates a Length from LightYear.

public static Length FromLightYears(double lightyears)

Parameters

lightyears double

Returns

Length

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

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromMegameters(double)

Creates a Length from Megameter.

public static Length FromMegameters(double megameters)

Parameters

megameters double

Returns

Length

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

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromMeters(double)

Creates a Length from Meter.

public static Length FromMeters(double meters)

Parameters

meters double

Returns

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromMicroinches(double)

Creates a Length from Microinch.

public static Length FromMicroinches(double microinches)

Parameters

microinches double

Returns

Length

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

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromMiles(double)

Creates a Length from Mile.

public static Length FromMiles(double miles)

Parameters

miles double

Returns

Length

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

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromMils(double)

Creates a Length from Mil.

public static Length FromMils(double mils)

Parameters

mils double

Returns

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromNanometers(double)

Creates a Length from Nanometer.

public static Length FromNanometers(double nanometers)

Parameters

nanometers double

Returns

Length

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

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromParsecs(double)

Creates a Length from Parsec.

public static Length FromParsecs(double parsecs)

Parameters

parsecs double

Returns

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromPicometers(double)

Creates a Length from Picometer.

public static Length FromPicometers(double picometers)

Parameters

picometers double

Returns

Length

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

Length

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

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromShackles(double)

Creates a Length from Shackle.

public static Length FromShackles(double shackles)

Parameters

shackles double

Returns

Length

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

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromTwips(double)

Creates a Length from Twip.

public static Length FromTwips(double twips)

Parameters

twips double

Returns

Length

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

Length

Exceptions

ArgumentException

If value is NaN or Infinity.

FromYards(double)

Creates a Length from Yard.

public static Length FromYards(double yards)

Parameters

yards double

Returns

Length

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.