You calculate q, according to eq. 3, based on the X-coordinate of the point you want to check. See it as a challenge-response tactic: first you 'challenge' the line to yield q based on the X-coordinate, then you check the 'response' by plugging in that value of q for the Y-coordinate and comparing the result to the Y-coordinate of your point.