TwinCAT Sinus Angle

Vijolica555

Level-1
Beiträge
23
Reaktionspunkte
0
Zuviel Werbung?
-> Hier kostenlos registrieren
Ich habe angle Array [LEN 325; 36°-144°) und will SIN kalkulieren.

Angle Array:
Code:
aAngle[0] := main.StartAngle; //36°
i := 0;
FOR j:= 1 TO  Main.ArrLen DO
            aAngle[j] := aAngle[i] + 0.33333333333333333333333333333333;
            i := i+1;
END_FOR

SIN:
Code:
FOR j:= 0 TO Main.ArrLen  DO
            aSinAngle[j]:= SIN(aAngle[j]);
END_FOR

SIN(36) ist 0,587785, aber in mein Fall bekam ich -0,991778851... Weiß jmd. wo die Problem ist?


Capture.jpgCapture1.PNG
 
Du musst der Funktion den Winkel als Radiant übergeben. Winkel[SUB](rad)[/SUB] = (Winkel[SUB](deg)[/SUB]*PI)/180
SIN(Winkel[SUB](rad)[/SUB]) sollte dann das korrekte Ergebnis liefern.
 
Zurück
Oben