Hallo,
Ich bin mal wieder an meinem Chemieprogramm an schreiben und bin auf ein Problem gestoßen.
ich berechne die Abstände mithilfe der Sinus und Cosinus Funktion
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16:
| alpha := anzahlwinkel*i+winkel; if ((alpha > 90) and (alpha <= 180)) or ((alpha > 270) and (alpha <= 360)) then begin X2 := X - trunc(cos(alpha*2*(PI/360)) * 7); Y2 := Y - trunc(sin(alpha*2*(PI/360)) * 7); X3 := X - trunc(cos(alpha*2*(PI/360)) * 40); Y3 := Y - trunc(sin(alpha*2*(PI/360)) * 40); end else begin X2 := X + trunc(cos(alpha*2*(PI/360)) * 7); Y2 := Y + trunc(sin(alpha*2*(PI/360)) * 7); X3 := X + trunc(cos(alpha*2*(PI/360)) * 40); Y3 := Y + trunc(sin(alpha*2*(PI/360)) * 40); end; |
Das Problem das ich teilweise negieren(quadrant 2 und 4) muss habe ich schon erkannt (siehe Code),
aber trotzdem klappt das nur wenn die Objektanzahl gerade ist.
Wenn sie ungerade ist klappt es nicht und ich hab gerade keine Ahnung woran das liegen kann.
ich wäre für jede Hilfe dankbar.
MFG DarkHunter
I believe that every human has a finite number of heart-beats. I don't intend to waste any of mine running around doing exercises.