Skip to content
Snippets Groups Projects
Commit db935f17 authored by Juan Sebastian Urrea Vega's avatar Juan Sebastian Urrea Vega
Browse files

Upload New File

parent 858250f3
No related branches found
No related tags found
No related merge requests found
import math
def errorrelativo(valorreal, valoraproximado):
return abs((valorreal - valoraproximado) / valorreal) * 100
def sen_aproximado(theta):
return theta
maxerror = 3.0
thetamaximo = math.radians(90)
for theta in range(1, int(math.degrees(thetamaximo)) + 1):
thetaenrads = math.radians(theta)
senoreal = math.sin(thetaenrads)
senoaprox = sen_aproximado(thetaenrads)
error = errorrelativo(senoreal, senoaprox)
if error > maxerror:
theta_maximo = math.radians(theta - 1)
break
print(f"El ángulo máximo para la aproximación con un error inferior al {maxerror}% es: {math.degrees(theta_maximo)} grados.")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment