Ciao...
Ich hab da ein kleines Problem bei der Berechnung eines Dreiecks.
Um die eine Kathete zu berechnen benötige ich die Funktion math.sin(x).
Meine Frage: In welchem Format muss in meinem Fall x sein? Bogenmass oder Gradmass?
Und: Hat evtl. jemand ein konkretes Beispiel?
thanx...
Winkel-Berechnung
pydoc math.sin sagt folgendes:
und radians heitß zumindest hiernach:
http://dict.tu-chemnitz.de/dings.cgi?la ... dlink=self
Bogenmaß
fs111
Code: Alles auswählen
Python Library Documentation: built-in function sin in math
math.sin = sin(...)
sin(x)
Return the sine of x (measured in radians).
http://dict.tu-chemnitz.de/dings.cgi?la ... dlink=self
Bogenmaß
fs111
-
- Python-Forum Veteran
- Beiträge: 2010
- Registriert: Freitag 11. Oktober 2002, 18:00
- Wohnort: Salzburg
- Kontaktdaten:
Hi snuupi,
das Modul math stellt auch Funktionen zum Umrechnen von Bogenmas in Grad und umgekehrt zur Verfügung.
Gruß
dookie
das Modul math stellt auch Funktionen zum Umrechnen von Bogenmas in Grad und umgekehrt zur Verfügung.
Code: Alles auswählen
from math import *
>>> print pi/2
1.5707963267948966
>>> print degrees(pi/2) # Bogenmaß in Grad
90.0
>>> print radians(90) # Grad in Bogenmaß
1.5707963267948966
dookie
Hi. Das umrechnen hast du gesucht? Na, das kann man doch zur Not auch selbst biegen, da steckt noch nicht mal groß Mathe dahinter, nur eine kleine Relation die du beliebig umstellen kannst (x in Gradmaß, y in Bogenmaß): (x/360)=(y/(2*PI))snuupi hat geschrieben:@dookie: nach sowas habe ich gesucht
thanx für eure Hilfe!!!
Milan
Zuletzt geändert von Milan am Montag 3. Mai 2004, 19:27, insgesamt 1-mal geändert.
-
- Python-Forum Veteran
- Beiträge: 2010
- Registriert: Freitag 11. Oktober 2002, 18:00
- Wohnort: Salzburg
- Kontaktdaten:
oder so:
Gruß
Dookie
Code: Alles auswählen
import math
rad_to_deg = lambda x: 180.0/math.pi * x
deg_to_rad = lambda x: math.pi/180 * x
print rad_to_deg(1.5707963267948966)
print deg_to_rad(90)
Dookie