ostk.physics.Unit¶
- class Unit¶
Bases:
pybind11_object
A unit of measurement is a definite magnitude of a quantity, defined and adopted by convention or by law, that is used as a standard for measurement of the same kind of quantity. Any other quantity of that kind can be expressed as a multiple of the unit of measurement.
Methods
Create a derived unit.
Get the unit type.
Check if the unit is defined.
Check if the unit is none.
Create a length unit.
Create a none unit.
Get the ratio to another unit.
Get the string representation of a unit type.
Get the string representation of the unit.
Create an undefined unit.
- class Type(self: ostk.physics.Unit.Type, value: int)¶
Bases:
pybind11_object
Members:
- Undefined :
Undefined unit type.
- None :
None unit type.
- Length :
Length unit type.
- Mass :
Mass unit type.
- Time :
Time unit type.
- Temperature :
Temperature unit type.
- ElectricCurrent :
Electric current unit type.
- LuminousIntensity :
Luminous intensity unit type.
- Derived :
Derived unit type.
- property name¶
- static derived(derived_unit: ostk::physics::unit::Derived::Unit) ostk.physics.Unit ¶
Create a derived unit.
- Parameters:
derived_unit (unit.Derived.Unit) -- A derived unit.
- Returns:
Derived unit.
- Return type:
- get_type(self: ostk.physics.Unit) ostk.physics.Unit.Type ¶
Get the unit type.
- Returns:
Unit type.
- Return type:
- is_defined(self: ostk.physics.Unit) bool ¶
Check if the unit is defined.
- Returns:
True if defined.
- Return type:
- is_none(self: ostk.physics.Unit) bool ¶
Check if the unit is none.
- Returns:
True if none.
- Return type:
- static length(length_unit: ostk::physics::unit::Length::Unit) ostk.physics.Unit ¶
Create a length unit.
- Parameters:
length_unit (unit.Length.Unit) -- A length unit.
- Returns:
Length unit.
- Return type:
- static none() ostk.physics.Unit ¶
Create a none unit.
- Returns:
None unit.
- Return type:
- ratio_to(self: ostk.physics.Unit, unit: ostk.physics.Unit) ostk.core.type.Real ¶
Get the ratio to another unit.
- static string_from_type(type: ostk.physics.Unit.Type) ostk.core.type.String ¶
Get the string representation of a unit type.
- to_string(self: ostk.physics.Unit) ostk.core.type.String ¶
Get the string representation of the unit.
- Returns:
String representation.
- Return type:
- static undefined() ostk.physics.Unit ¶
Create an undefined unit.
- Returns:
Undefined unit.
- Return type: