# How do I find which line connected two squares?

In the Permissive Field of View algorithm, a destination square is visible from a source square if any unobstructed line can be drawn from the source square to the destination square. The algorithm works by defining a series of view fields (essentially, triangles) and checking if the destination square exists inside of a view field.

Unfortunately, the algorithm does not make available the actual line that it found between the source square and the destination square; it only tells you whether such a line is guaranteed to exist.

How can I find the line, presuming it is guaranteed to exist?

I've tried plotting lines between the edges of the source square to the edges of the destination square, but this apparently is just an approximation (it can fail to find the line).

-
There's also a page there that talks about DFOV, a similar algorithm with the advantage that it makes it easy to draw "target lines". Alternatively, you could just use a bare-bones line-of-sight algorithm once you know a particular target is visible. – Geobits Jan 15 '14 at 18:50