Tidy up `distanceToIntersection`
Add a type declaration to `main`
Turn on -Wall
Add a type declaration to `fileName`
Add type declarations for camera control values

This is `d`, `left`, `right`, `top` and `bottom`.
Rename `length` to `mag`

This avoids shadowing the top-level `length`.
Rename the top-level `fileName`

It's now `outputFileName`. This conveys its usage more clearly and
avoids shadowing issues in `removeIfExists`.
Shorten the width, height declarations