Skip to content

Instantly share code, notes, and snippets.

@BlivionIaG
Last active June 3, 2021 18:31
Show Gist options
  • Save BlivionIaG/9a76381240dc66ab35aa5bda59c16d93 to your computer and use it in GitHub Desktop.
Save BlivionIaG/9a76381240dc66ab35aa5bda59c16d93 to your computer and use it in GitHub Desktop.
formeTrigo
from math import *
# a = float(input("Entrez a: "))
# b = float(input("Entrez b: "))
a = 2*sqrt(2)
b = 2*sqrt(2)
if a == 0 and b == 0:
print("A et B ne peuvent pas être nul.")
exit(1)
modZ = sqrt(pow(a, 2)+pow(b, 2))
theta = acos(a / modZ) if b == 0 else asin(b / modZ)
nom, denom = round(theta/pi, 6).as_integer_ratio()
print(modZ + " * ( cos( (" + nom+ "/" + denom + ")𝜋 ) + 𝒊sin( (" + nom + "/"+denom+ ")𝜋 )")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment