BioSimSpace.Types.Area¶
-
class
BioSimSpace.Types.
Area
(*args)¶ An area type.
-
__init__
(*args)¶ Constructor.
*args
can be a magnitude and unit, or a string representation of the area, e.g. “30 nm^2”.- Parameters
magnitude (float) – The magnitude.
unit (str) – The unit.
string (str) – A string representation of the area.
Examples
Create an object representing an area of 30 square nanometers then print the area in square Angstrom.
>>> import BioSimSpace as BSS >>> area = BSS.Types.Area(30, "nm^2") >>> print(area.angstroms2())
The same as above, except passing a string representation of the area to the constructor.
>>> import BioSimSpace as BSS >>> area = BSS.Types.Area("30 nm^2") >>> print(area.angstroms2())
The string matching is extremeley flexible, so all of the following would be valid arguments: “30 nm^2”, “30 square nanometers”, “30 nanometers squared”.
Methods
__init__
(*args)Constructor.
Return the area in square Angstrom.
Return the magnitude.
meters2
()Return the area in square meters.
Return the area in square nanometers.
Return the area in square picometers.
unit
()Return the unit.
-
angstroms2
()¶ Return the area in square Angstrom.
- Returns
area – The area in square Angstrom.
- Return type
-
magnitude
()¶ Return the magnitude.
- Returns
magnitude – The magnitude of the type.
- Return type
float
-
meters2
()¶ Return the area in square meters.
- Returns
area – The area in square meters.
- Return type
-
nanometers2
()¶ Return the area in square nanometers.
- Returns
area – The area in square nanometers.
- Return type
-
picometers2
()¶ Return the area in square picometers.
- Returns
area – The area in square picometers.
- Return type
-
unit
()¶ Return the unit.
- Returns
unit – The unit of the type.
- Return type
str
-