ostk.physics.unit.Mass

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

Bases: pybind11_object

Mass.

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

Constructor.

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

  • aUnit (Mass.Unit) -- A mass unit.

Methods

get_unit

Get the mass unit.

in_kilograms

Convert mass to kilograms.

in_unit

Convert mass to unit.

is_defined

Check if the mass is defined.

kilograms

Create a mass in kilograms.

parse

Parse a mass.

string_from_unit

Get string from unit.

symbol_from_unit

Get symbol from unit.

to_string

Convert mass to string.

undefined

Get an undefined mass.

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

Bases: pybind11_object

Members:

Undefined :

Undefined.

Kilogram :

Kilogram (SI).

Pound :

Pound.

Tonne :

Tonne.

property name
get_unit(self: ostk.physics.unit.Mass) ostk::physics::unit::Mass::Unit

Get the mass unit.

Returns:

Mass unit.

Return type:

Mass.Unit

in_kilograms(self: ostk.physics.unit.Mass) ostk.core.type.Real

Convert mass to kilograms.

Returns:

Mass in kilograms.

Return type:

float

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

Convert mass to unit.

Returns:

Mass in unit.

Return type:

float

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

Check if the mass is defined.

Returns:

True if defined.

Return type:

bool

static kilograms(arg0: ostk.core.type.Real) ostk.physics.unit.Mass

Create a mass in kilograms.

Returns:

A mass in kilograms.

Return type:

Mass

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

Parse a mass.

Returns:

A mass.

Return type:

Mass

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

Get string from unit.

Returns:

A string.

Return type:

str

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

Get symbol from unit.

Returns:

A symbol.

Return type:

str

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

Convert mass to string.

Parameters:

aPrecision (int) -- Precision.

Returns:

Mass as string.

Return type:

str

static undefined() ostk.physics.unit.Mass

Get an undefined mass.

Returns:

An undefined mass.

Return type:

Mass