Ich verwende Numpys trigonometrische Funktionen und fand gerade etwas Faszinierendes: Ich weiß, dass die Sinus- und Cosinus -Funktionen eine unendliche Domäne haben, aber aus einigen Gründen np.cos () und np.sin ()
from numpy import pi
# Just in order to keep it simple
π = pi
def sin(x):
# If our angle is bigger than 360°
if x >= 2*π:
while x >= 2*π:
x -= 2*π
# If our angle is smaller than 0°
elif x < 0:
while x < 0:
x += 2*π
# If our angle is in [0, 2*π[ domain
return result
< /code>
Ist es etwas, das aus mathematischer Sicht nicht funktionieren würde? Warum?
Numpys Cosinus- und Sinusdomänen ⇐ Python
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Wie man Cosinus Ähnlichkeit der Worteinbettung aus dem Bert -Modell bekommt
by Anonymous » » in Python - 0 Replies
- 13 Views
-
Last post by Anonymous
-