Die Lösung für Delphi sähe folgendermaßen aus:
Code:
if (Liniex1 = Liniex2) and (Punktx = Liniex1) then
if (((liniey1 <= liniey2) and ((liniey1 <= punkty) and (punkty <= liniey2))) or ((liniey1 >= liniey2) and ((liniey2 <= punkty) and (punkty <= liniey1)))) then
result := true
else
result := false
else
if (Punkty = Liniey1 + ((Punktx - Liniex1) * (Liniey2 - Liniey1) / (Liniex2 - Liniex1)))
and (((liniex1 <= liniex2) and ((liniex1 <= punktx) and (punktx <= liniex2))) or ((liniex1 >= liniex2) and ((liniex2 <= punktx) and (punktx <= liniex1))))
and (((liniey1 <= liniey2) and ((liniey1 <= punkty) and (punkty <= liniey2))) or ((liniey1 >= liniey2) and ((liniey2 <= punkty) and (punkty <= liniey1)))) then
result := true
else
result := false;
Sicher ist das jetzt viel zu umständlich gedacht, und du musst es auch noch in die Sprache deiner Wahl umschreiben, aber immerhin - es funktioniert. ^^ (Hat zumindest bei zwanzig Tests funktioniert, natürlich kann ich für nichts garantieren...)