Autor Beitrag
Vitalic
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 68



BeitragVerfasst: Mo 24.05.10 18:28 
Hallo alle zusammen,

ich würde gerne folgende Matrix in C# lösen.


x2-x1 y2-y1 z2-z1 | k1
x3-x1 y3-y1 z3-z1 | k2
x4-x1 y4-y1 z4-z1 | k3

Um nun x, y und z zu berechnen kann man die Werte z.B. in den Taschenrechner eingeben und man bekommt die Lösung für die x,y,z-Koordinaten heraus.

Man kann sicherlich auch die Gleichung ausrechnen, bekommt aber eine sehr große Rechnung, die mühsam abzutippen ist.

Es muss also eine Möglichkeit geben das ganze einfacher zu berechnen?

Danke für die Mühe!!!

Grüße

Vitalic
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mo 24.05.10 18:35 
Was genau, willst Du berechnen? Wie hängen die Zahlen zusemmen?

Mein Post-Compiler meint nur
E0815: Post unverständlich: Inkompatible Reihenfolge von Schreiben und Denken.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Mo 24.05.10 18:36 
Hi :)

Ich bin mir nicht ganz sicher: Den Algorithmus von Gauß und Jordan(Erweiterung des klassischen Gauß aus der Schule) kennst du?
Wenn nicht, würde ich mir einmal die Quelltexte in den Artikeln der Deutschen und Englischen Wikipedia ansehen.

Oder geht es dir um die Darstellung, also einen möglichst eleganten Datentyp für diese Matrix?

lg,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
Vitalic Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 68



BeitragVerfasst: Mo 24.05.10 19:05 
Hallo,

also ich habe folgende Gleichung.

(x2-x1)x0+(y2-y1)y0+(z2-z1)z0=k1
(x3-x1)x0+(y3-y1)y0+(z3-z1)z0=k2
(x4-x1)x0+(y4-y1)y0+(z4-z1)z0=k3

So sieht dann die Matrix aus:

x2-x1 y2-y1 z2-z1 | k1
x3-x1 y3-y1 z3-z1 | k2
x4-x1 y4-y1 z4-z1 | k3

und ich möchte nun die Lösung Programmieren, also die Werte für

x = ?
y = ?
z = ?

Wenn ich das rechnerisch mache, dann kommt eine viel zu lange Lösung raus.
Muss also auch hierfür einen einfachen Algorithmus geben.

Grüße

Vitalic
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Mo 24.05.10 19:30 
Hallo :D

Dann lies einfach meinen Post - Algorithmus von Gauß und Jordan. Und eigentlich solltet ihr den Gauß in Mathe gehabt haben.
Dass im allgemeinen Fall so komplizierte Gleichungen rauskommen liegt daran, dass man beim Programmieren die konkreten Werte noch nicht kennt. Der Algo ist auch genau das, was dein Taschenrechner macht, nachdem du die Zahlen kennst und eingegeben hast.

lg,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)


Zuletzt bearbeitet von Hidden am Mo 24.05.10 20:12, insgesamt 1-mal bearbeitet
Vitalic Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 68



BeitragVerfasst: Mo 24.05.10 19:34 
Hallo,

es ist mir klar wie Gauß und Jordan Algorithmus geht.

Nur den anzuwenden und zu programmieren sind 2 verschiedene Sachen :D

Grüße

Vitalic
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mo 24.05.10 20:11 
Du musst dich im Wesentlichen erstmal drauf einigen, wie du deine Matrix aufbaust. Ob Du Zeilen oder Spalten im ersten Index angibst und dann schaust Du mal kurz bei der Mathe-Bibliothek deines Vertrauens die Funktion SolveLES an, die zeigt es Beispielhaft, wie's geht.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.