Home | Trees | Indices | Help |
|
---|
|
Physical quantity with units
PhysicalQuantity instances allow addition, subtraction, multiplication, and division with each other as well as multiplication, division, and exponentiation with numbers. Addition and subtraction check that the units of the two operands are compatible and return the result in the units of the first operand. A limited set of mathematical functions (from module Numeric) is applicable as well:
|
|||
__abs__(self) | |||
__add__(self, other) | |||
__cmp__(self, other) | |||
__div__(self, other) | |||
__init__(self,
*args) There are two constructor calling patterns: |
|||
__mul__(self, other) | |||
__neg__(self) | |||
__nonzero__(self) | |||
__pos__(self) | |||
__pow__(self, other) | |||
__radd__(self, other) | |||
__rdiv__(self, other) | |||
__repr__(self) | |||
__rmul__(self, other) | |||
__rpow__(self, other) | |||
__rsub__(self, other) | |||
__str__(self) | |||
__sub__(self, other) | |||
_sum(self, other, sign1, sign2) | |||
convertToUnit(self,
unit) Change the unit and adjust the value such that the combination is equivalent to the original one. |
|||
cos(self) | |||
PhysicalQuantity |
inBaseUnits(self) Returns the same quantity converted to base units, i.e. |
||
PhysicalQuantity or tuple of PhysicalQuantity
|
inUnitsOf(self,
*units) Express the quantity in different units. |
||
bool
|
isCompatible(self,
unit) Returns True if the specified unit is compatible with the one
of the quantity
|
||
sin(self) | |||
sqrt(self) | |||
tan(self) |
|
|||
_number = <_sre.SRE_Pattern object at 0x572aa0>
|
|
|
|
|
|
There are two constructor calling patterns:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Change the unit and adjust the value such that the combination is equivalent to the original one. The new unit must be compatible with the previous unit of the object.
|
|
|
Express the quantity in different units. If one unit is specified, a new PhysicalQuantity object is returned that expresses the quantity in that unit. If several units are specified, the return value is a tuple of PhysicalObject instances with with one element per unit such that the sum of all quantities in the tuple equals the the original quantity and all the values except for the last one are integers. This is used to convert to irregular unit systems like hour/minute/second.
|
|
|
|
|
|
_number
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0alpha3 on Fri Oct 6 14:45:45 2006 | http://epydoc.sourceforge.net |