The slope of a line perpendicular to the x-axis is undefined.
Perpendicular lines have opposite reciprocal slopes.
For example ##1/2## and ##-2/1=-2## are opposite reciprocals and lines with these slopes will be perpendicular to one another.
If the x-axis is treated as a horizontal line we can pick two points on the line such as (00) and (10).
The slope of a line is ##m={y_2-y_1}/{x_2-x_1}##. So the two points we have selected:
##(00)=(x_1y_1)## and ##(10)=(x_2y_2)##.
Using the slope formula ##m={0-0}/{1-0}=0/{1}=0##.
The opposite reciprocal of a slope of zero would be undefined because we cannot divide by zero.
Alternatively you can use the slope formula and two points on the vertical line x=1 for example. Randomly picking the points (10) and (11).
The slope would be ##m={1-0}/{1-1}## and this is undefined.
Very good explanation of slopes with good graphs and the answer to the question with additional info here http://www.themathpage.com/alg/slope-of-a-line.htm