def segment_to_fraction(distance):
 if np.isnan(distance):
  return fr.Fraction(0, 1)
 else:
  fract = fr.Fraction(distance).limit_denominator(10)
  return fr.Fraction(fract.denominator, fract.numerator)

def segment_to_fraction ( distance ) : if np . isnan ( distance ) : return fr . Fraction ( 0 , 1 ) else : fract = fr . Fraction ( distance ) . limit_denominator ( 10 ) return fr . Fraction ( fract . denominator , fract . numerator )
converts lengths of which the plane cuts the axes to fraction .