ostk.physics.unit.Length

class Length(
self: ostk.physics.unit.Length,
arg0: ostk.core.type.Real,
arg1: ostk::physics::unit::Length::Unit,
)

Bases: pybind11_object

Length.

https://en.wikipedia.org/wiki/Length

Constructor.

Parameters:
  • aReal (Real) -- A real number.

  • aUnit (Length.Unit) -- A length unit.

Methods

get_unit

Get the length unit.

in_kilometers

Get the length in kilometers.

in_meters

Get the length in meters.

in_unit

Get the length in a given unit.

is_defined

Check if the length is defined.

is_zero

Check if the length is zero.

kilometers

Construct a length in kilometers.

meters

Construct a length in meters.

millimeters

Construct a length in millimeters.

parse

Parse a string and construct a length.

string_from_unit

Get the string representation of a length unit.

symbol_from_unit

Get the symbol of a length unit.

to_string

Get the string representation of the length.

undefined

Get an undefined length.

class Unit(self: ostk.physics.unit.Length.Unit, value: int)

Bases: pybind11_object

Members:

Undefined :

Undefined length unit.

Meter :

Meter (SI).

Foot :

Foot.

TerrestrialMile :

Terrestrial mile.

NauticalMile :

Nautical mile.

AstronomicalUnit :

Astronomical Unit.

property name
__add__(
self: ostk.physics.unit.Length,
arg0: ostk.physics.unit.Length,
) ostk.physics.unit.Length
__mul__(
self: ostk.physics.unit.Length,
arg0: ostk.core.type.Real,
) ostk.physics.unit.Length
get_unit(self: ostk.physics.unit.Length) ostk::physics::unit::Length::Unit

Get the length unit.

Returns:

The length unit.

Return type:

Length.Unit

in_kilometers(self: ostk.physics.unit.Length) ostk.core.type.Real

Get the length in kilometers.

Returns:

The length in kilometers.

Return type:

float

in_meters(self: ostk.physics.unit.Length) ostk.core.type.Real

Get the length in meters.

Returns:

The length in meters.

Return type:

float

in_unit(
self: ostk.physics.unit.Length,
arg0: ostk::physics::unit::Length::Unit,
) ostk.core.type.Real

Get the length in a given unit.

Returns:

The length in the given unit.

Return type:

float

is_defined(self: ostk.physics.unit.Length) bool

Check if the length is defined.

Returns:

True if defined.

Return type:

bool

is_zero(self: ostk.physics.unit.Length) bool

Check if the length is zero.

Returns:

True if zero.

Return type:

bool

static kilometers(arg0: ostk.core.type.Real) ostk.physics.unit.Length

Construct a length in kilometers.

Returns:

A length in kilometers.

Return type:

Length

static meters(arg0: ostk.core.type.Real) ostk.physics.unit.Length

Construct a length in meters.

Returns:

A length in meters.

Return type:

Length

static millimeters(arg0: ostk.core.type.Real) ostk.physics.unit.Length

Construct a length in millimeters.

Returns:

A length in millimeters.

Return type:

Length

static parse(arg0: ostk.core.type.String) ostk.physics.unit.Length

Parse a string and construct a length.

Parameters:

aString (str) -- A string.

Returns:

A length.

Return type:

Length

static string_from_unit(
arg0: ostk::physics::unit::Length::Unit,
) ostk.core.type.String

Get the string representation of a length unit.

Returns:

The string representation.

Return type:

str

static symbol_from_unit(
arg0: ostk::physics::unit::Length::Unit,
) ostk.core.type.String

Get the symbol of a length unit.

Returns:

The symbol.

Return type:

str

to_string(
self: ostk.physics.unit.Length,
aPrecision: ostk.core.type.Integer = Undefined,
) ostk.core.type.String

Get the string representation of the length.

Parameters:

aPrecision (int) -- A precision.

Returns:

The string representation.

Return type:

str

static undefined() ostk.physics.unit.Length

Get an undefined length.

Returns:

An undefined length.

Return type:

Length