The distance between a point and a line is the length of the perpendicular segment from the point to the line. In this case, that is AY. The distance from A to Y can be calculated using the Distance Formula.
d = sqrt((x_2-x_1)^2 + (y_2-y_1)^2)
By substituting the points for A and Y into the formula we can calculate the distance