Last active
June 3, 2021 18:31
-
-
Save BlivionIaG/9a76381240dc66ab35aa5bda59c16d93 to your computer and use it in GitHub Desktop.
formeTrigo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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