The horizontal line test is a graphical method for determining whether a function is one-to-one. A function passes the horizontal line test iff every horizontal line intersects its function graph in at most one point.
Indeed, a horizontal line with height intersects the graph at every point
for which
. Therefore, such a line intersects the graph more than
once precisely when there are distinct values
and
such that
. In particular, a function has an inverse
function on its range iff it passes the horizontal line
test.