Autor Beitrag
DarkHunter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 477

Win XP
D3 Prof, D2005 PE
BeitragVerfasst: Di 15.11.05 22:19 
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
ausblenden 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.
- Neil Armstrong
DarkHunter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 477

Win XP
D3 Prof, D2005 PE
BeitragVerfasst: Mi 16.11.05 21:23 
Ok ich hab den Fehler gefunden
die Abfrage war überflüssig, nun geht es.

_________________
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.
- Neil Armstrong