Bah, I think I confused myself 😕
if (((($y1 - $slopep * $x1 > $yp1 - $slopep * $xp1)&&($y2 - $slopep * $x2 < $yp1 - $slopep * $xp1))||(($y1 - $slopep * $x1 < $yp1 - $slopep * $xp1)&&($y2 - $slopep * $x2 > $yp1 - $slopep * $xp1)))&&((($yp1 - $slope * $xp1 > $y1 - $slope * $x1)&&($yp2 - $slope * $xp2 < $y1 - $slope * $x1))||(($yp1 - $slope * $xp1 < $y1 - $slope * $x1)&&($yp2 - $slope * $xp2 > $y1 - $slope * $x1))))
{
return 1;
}
And yes, it's formatted much more nicely in my actual code... but damn, it's one hell of a long 'if'.
Nicely formatted:
if (((($y1 - $slopep * $x1 > $yp1 - $slopep * $xp1)&&($y2 - $slopep * $x2 < $yp1 - $slopep * $xp1))||(($y1 - $slopep * $x1 < $yp1 - $slopep * $xp1)&&($y2 - $slopep * $x2 > $yp1 - $slopep * $xp1)))&&((($yp1 - $slope * $xp1 > $y1 - $slope * $x1)&&($yp2 - $slope * $xp2 < $y1 - $slope * $x1))||(($yp1 - $slope * $xp1 < $y1 - $slope * $x1)&&($yp2 - $slope * $xp2 > $y1 - $slope * $x1))))
{
return 1;
}
And yes, it's formatted much more nicely in my actual code... but damn, it's one hell of a long 'if'.
Nicely formatted: