Is there an error with the following code?
imagedashedline($image, $posax, $posay, $posbx, $posay, $black);
What it shows is:

I tried it like this:
imageline($image, $posax, $posay, $posbx, $posay, $black);
And what it shows is:

and it worked perfectly in the gd code. What really befuddles me is the dashed line which is going vertically downwards. It is not being blocked at all. If it is because the triangle area overlaps it, then the bottom line should at least partially show. So what must be the error? Is it that imagepolygon has a higher z-index than imagedashedline, but not higher than imageline? (a polygon partially covers this should-be dashed line.) But both imagedashedline statements (one to create the vertical line and the other to create the horizontal line) are executed after the imagepolygon function, so they should both not show, if z-index is the case.
EDIT: I worked out the reason, and found that horizontal imagedashedline lines have a height of 0, making them invisible to the eye. Any other tilted angle will work, as long as you increase the imagesetthickness function value. See if that helps.
Ah I found the answer – the horizontal line has a height of 0px as the line is completely horizontal. Making the line have the slightest tilt to it makes it visible again.