The dot product of two vectors (a,b) and (x,y) is defined to be[an error occurred while processing this directive]ax + by . This number will be zero if and only if the two vectors are perpendicular. We can see this using slopes. If the first vector lies along the y-axis, soa = 0 , thenax + by = 0 only ifby = 0 , so eitherb = 0 and(a,b) = (0,0) , ory = 0 and (x,y) lies along the x-axis. Thus the two vectors have dot product 0 if, and only if, they are perpendicular.Next, if neither vector has slope 0, the vectors (a,b) and (x,y) will be perpendicular if and only if their slopes are negative reciprocals, i.e. if
(^{b}/_{a})(^{y}/_{x}) = -1 = ^{by}/_{ax}, so-ax = by andax + by = 0 .Geometrically, we know that two vectors are perpendicular if the Pythagorean Theorem holds, i.e. the square of the length of (a,b) plus the square of the length of (x,y) equals the square of the length of
(a,b)-(x,y) = (a-x,b-y) . This means thata^{2} + b^{2} + x^{2} + y^{2} =(a-x)^{2} + (b-y)^{2} =a^{2} - 2ax + x^{2} - 2by + y^{2} . From this it follows that0 = -2ax - 2by , soax + by = 0 .