0

formula in question I'm trying to write down the equation above in python code, already using math library to calculate cos. I tried the following code, but it gave me the error: "TypeError: 'float' object is not callable"

def tempo_transito(periodo, raio_estrela, semieixo, raio_planeta, inclinacao):
    tempo = (periodo/sci.pi)*math.asin((raio_estrela/semieixo)*(((((1-(raio_planeta/raio_estrela))**2) - ((semieixo)/(raio_estrela*math.cos(math.radians(inclinacao))))**2))(1-(math.cos(math.radians(inclinacao)))**2))**(1/2))
    return tempo

when the fuction is called, gives the error

If anyone could write it down, sure would be enough, or point my error in the code

  • A calculation with that many parenthesis is just begging to be broken up into multiple lines. You'll probably find the issue if you break it into smaller chunks. – picobit Nov 09 '22 at 19:19
  • thank you! I FINALLY got to solve this, idk what was the problem lol, but got the awnser I was looking for – Matheus Nov 13 '22 at 21:38

0 Answers0