httk.core.vectors.fracmath module¶
- httk.core.vectors.fracmath.any_to_fraction(arg, min_accuracy=Fraction(1, 10000))[source]¶
min_accuracy: we always assume the accuracy is at least this good. i.e., with min_accuracy=1/10000, we take 0.33 to really mean 0.3300, because we assume people meaning 1/3 at least makes the effort to write 0.3333
- httk.core.vectors.fracmath.frac_acos(x, degrees=False, prec=Fraction(1, 10000000000), limit=True)[source]¶
Return the arccosine of x in radians.
- httk.core.vectors.fracmath.frac_acos_alt(x, degrees=False, prec=Fraction(1, 10000000000), limit=True)[source]¶
Return the arc cosine (measured in radians) of Decimal x.
- httk.core.vectors.fracmath.frac_acos_old(x, degrees=False, prec=Fraction(1, 10000000000), limit=True)[source]¶
Return the arc cosine (measured in radians) of Decimal x.
- httk.core.vectors.fracmath.frac_asin(x, degrees=False, prec=Fraction(1, 10000000000), limit=True)[source]¶
Return the arc sine (measured in radians) of Decimal x.
- httk.core.vectors.fracmath.frac_atan(x, degrees=False, prec=Fraction(1, 10000000000), limit=True)[source]¶
Return the arctangent of x in radians.
- httk.core.vectors.fracmath.frac_atan2(y, x, degrees=False, prec=Fraction(1, 10000000000), limit=True)[source]¶
Return the arctangent of y/x in radians.
Unlike atan(y/x), the signs of both x and y are considered.
- httk.core.vectors.fracmath.frac_atan_old(x, degrees=False, prec=Fraction(1, 10000000000), limit=True)[source]¶
Return the arctangent of x in radians.
- httk.core.vectors.fracmath.frac_cos(x, prec=Fraction(1, 10000000000), limit=True, degrees=False)[source]¶
- httk.core.vectors.fracmath.frac_exp(x, prec=Fraction(1, 10000000000), limit=True)[source]¶
Return e raised to the power of x.
- httk.core.vectors.fracmath.frac_exp_old(x, prec=Fraction(1, 10000000000), limit=True)[source]¶
Return e raised to the power of x.
- httk.core.vectors.fracmath.frac_log(x, base=None, prec=Fraction(1, 10000000000), limit=True)[source]¶
Return the logarithm of x to the given base.
If the base not specified, return the natural logarithm (base e) of x.
TODO: Fix: this fails for moderately large arguments.
- httk.core.vectors.fracmath.frac_log10(x, prec=Fraction(1, 10000000000), limit=True)[source]¶
Return the base 10 logarithm of x.
- httk.core.vectors.fracmath.frac_log_old(x, base=None, prec=Fraction(1, 10000000000), limit=True)[source]¶
Return the logarithm of x to the given base.
If the base not specified, return the natural logarithm (base e) of x.
- httk.core.vectors.fracmath.frac_pi(prec=Fraction(1, 10000000000), limit=True)[source]¶
Compute Pi to the precision prec.
- httk.core.vectors.fracmath.frac_pi_old(prec=Fraction(1, 10000000000), limit=True)[source]¶
Compute Pi to the precision prec.
- httk.core.vectors.fracmath.frac_sin(x, prec=Fraction(1, 10000000000), limit=True, degrees=False)[source]¶
- httk.core.vectors.fracmath.frac_sin_old(x, prec=Fraction(1, 10000000000), limit=True, degrees=False)[source]¶
- httk.core.vectors.fracmath.frac_tan(x, degrees=False, prec=Fraction(1, 10000000000), limit=True)[source]¶
Return the tangent of x.