Hide menu
Loading...
Searching...
No Matches
manufacturingtoolkit.CadExMTK.Drawing_Ratio Class Reference

Ratio Ratio.hxx cadex/Drawing/Ratio.hxx. More...

Inheritance diagram for manufacturingtoolkit.CadExMTK.Drawing_Ratio:

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.
 

Detailed Description

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.

See also
View.Scale()

Constructor & Destructor Documentation

◆ __init__()

manufacturingtoolkit.CadExMTK.Drawing_Ratio.__init__ ( self,
* args )

Constructor.

Initializes with user-defined ratio.

Warning
0 does not make sense for and should not be passed to either of the parameters.

Member Function Documentation

◆ Denominator()

manufacturingtoolkit.CadExMTK.Drawing_Ratio.Denominator ( self)

Returns the denominator of the ratio (i.e.

\(m\) from \((n:m)\)).

◆ IsEqual()

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}\).

◆ Numerator()

manufacturingtoolkit.CadExMTK.Drawing_Ratio.Numerator ( self)

Returns the numerator of the ratio (i.e.

\(n\) from \((n:m)\)).

◆ SetDenominator()

manufacturingtoolkit.CadExMTK.Drawing_Ratio.SetDenominator ( self,
theDenominator )

Sets the denominator of the ratio (i.e.

\(m\) from \((n:m)\)).

Warning
0 does not make sense for and should not be supplied to this parameter.

◆ SetNumerator()

manufacturingtoolkit.CadExMTK.Drawing_Ratio.SetNumerator ( self,
theNumerator )

Sets the numerator of the ratio (i.e.

\(n\) from \((n:m)\)).

Warning
0 does not make sense for and should not be supplied to this parameter.

The documentation for this class was generated from the following file:
  • CadExMTK.py