Autor Beitrag
Delphi~Anfänger
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 97



BeitragVerfasst: Mi 12.05.04 14:08 
Code zum ausrechnen des Flächeninhaltes eines Dreiecks gesucht :o

Wenn ihr mir helfen könnt danke im voraus
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mi 12.05.04 14:13 
also die formel zum berechnen dise inhaltes hast doch doch oder ? die ist doch einfach in delphi umzusetzten ??

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Sven
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 314


D6 Ent, K3 Pro (patched)
BeitragVerfasst: Mi 12.05.04 14:14 
Diese Funktione berechnet die Fläche jeder beliebigen Form.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
function Gauss_Elling(mpt: array of TFPoint): double;
  var i  : integer;
      res: double;
begin  
  result := 0;
  for i:=0 to High(mpt) do begin
    if i < High(mpt) then begin
      res    := ((mpt[i].x * mpt[i+1].y) -
                 (mpt[i].y * mpt[i+1].x));
      result := result + res;
    end
    else begin
      {letzter Punkt}
      res    := ((mpt[i].x * mpt[0].y) -
                 (mpt[i].y * mpt[0].x));
      result := result + res;
    end
  end;
  result := Abs(result) / 2
end; {Gauss-Elling}

_________________
MDK 9.1, Kernel 2.4.21, KDE 3.1 Kylix 3 Pro (patched), nutze aber auch Windows
Delphi~Anfänger Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 97



BeitragVerfasst: Mi 12.05.04 14:14 
thx :D