Parallel and perpendicular lines

Two straight lines with the same gradient are parallel. The red and blue lines below both have a gradient of 3.

For a straight line to be perpendicular to another line the gradient has to be in the opposite direction to the other line. If the gradient of the first line is m then any line perpendicular to that line will have a gradient of -\frac{1}{m}.