Removed line carried over from original IDL port.
Added documentation to the triangle threshold calculation.