Two lines are perpendicular when their gradients multiply to make −1. See why: a quarter turn swaps the rise and the run, and flips the sign.