Ratio Ratio.hxx cadex/Drawing/Ratio.hxx. More...
Public Member Functions | |
__init__ (self, *args) | |
Constructor. | |
Numerator (self) | |
Returns the numerator of the ratio (i.e. | |
SetNumerator (self, theNumerator) | |
Sets the numerator of the ratio (i.e. | |
Denominator (self) | |
Returns the denominator of the ratio (i.e. | |
SetDenominator (self, theDenominator) | |
Sets the denominator of the ratio (i.e. | |
ToDouble (self) | |
Converts the ratio to double floating-point number. | |
IsEqual (self, theOther) | |
Returns true if the ratios are equal. | |
IsNotEqual (self, theOther) | |
Returns true if the ratios are not equal. | |
Ratio Ratio.hxx cadex/Drawing/Ratio.hxx.
Holds the ratio of 2 positive integers in the form of \((n:m)\).
Can be used to define the scale factor in certain situations. The numerator and denominator are not reduced, they are stored as is.
manufacturingtoolkit.CadExMTK.Drawing_Ratio.__init__ | ( | self, | |
* | args ) |
Constructor.
Initializes with user-defined ratio.
manufacturingtoolkit.CadExMTK.Drawing_Ratio.Denominator | ( | self | ) |
Returns the denominator of the ratio (i.e.
\(m\) from \((n:m)\)).
manufacturingtoolkit.CadExMTK.Drawing_Ratio.IsEqual | ( | self, | |
theOther ) |
Returns true if the ratios are equal.
Given 2 ratios \((n:m)\) and \((p:q)\) their equality is tested as equality of rational numbers \(\frac{n}{m}\) and \(\frac{p}{q}\).
manufacturingtoolkit.CadExMTK.Drawing_Ratio.Numerator | ( | self | ) |
Returns the numerator of the ratio (i.e.
\(n\) from \((n:m)\)).
manufacturingtoolkit.CadExMTK.Drawing_Ratio.SetDenominator | ( | self, | |
theDenominator ) |
Sets the denominator of the ratio (i.e.
\(m\) from \((n:m)\)).
manufacturingtoolkit.CadExMTK.Drawing_Ratio.SetNumerator | ( | self, | |
theNumerator ) |
Sets the numerator of the ratio (i.e.
\(n\) from \((n:m)\)).