Three possible methods use coordinates, vectors or complex numbers.