Lineare Gleichung lösen

Saheeda

Top Contributor
Hallo,

die Frage ist mir fast schon peinlich, aber ich scheitere gerade daran eine lineare Gleichung zu lösen...

Java:
            double s; //"Use of unassigned value"
            double t = 1;

            //x1, y1, x2, y2
            Path a = new Path(0, 0, 100, 100);

            //x3, y3, x4, y4
            Path b = new Path(100, 0, 0, 100);

            int x = b.Start.X - a.Start.X;
            int y = b.Start.Y - a.Start.Y;

            double interSectX = s*(a.End.X - a.Start.X) - t*(b.End.X - b.Start.X);
            double interSectY = s*(a.End.Y - a.Start.Y) - t*(b.End.Y - b.Start.Y);

            s = (x + t * (b.End.X - b.Start.X)) / (a.End.X - a.Start.X);
            t = -(y - s * (a.End.Y - a.Start.Y)) / (b.End.Y - b.Start.Y);

Ich muss s und t irgendwelche Start-Werte zuweisen, da ich sonst die Fehlermeldung erhalte "Use of unassigned value 's'". Aber gerade diese beiden Parameter möchte ich ja rauskriegen...
 

Zurück
Oben