Answer the question
In order to leave comments, you need to log in
Non-decimal fractions and Python how?
There is an expression cos (a) / sin (a), in simple terms it is arctg (a).
sin(alpha) = a/c
cos(alpha) = b/c
As far as I understand (not strong in trigonometry, because I'm an eighth grader). Everyone knows that when dividing a sine by a cosine, c will decrease. I need to get ax and bx from this expression, where x is a certain coefficient. x is arbitrary and is set by me directly from the code. That is, in fact, I need to get the numerator and denominator separately of the fraction a / b, while not knowing c.
Answer the question
In order to leave comments, you need to log in
There is a sympy
module in Python for this .
I can’t figure out what expression you need to compose, but it copes with symbolic mathematics:
import sympy as sym
x = sym.Symbol('x')
sym.simplify(sym.sin(x)/sym.cos(x))
# tan(x)
a = sym.Symbol('a')
b = sym.Symbol('b')
c = sym.Symbol('c')
sym.simplify((a/c)/(b/c))
# a/b
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question