Based on the following information from a past paper:

Sincep = sin40andq = cos110.

and therefore sin140 = p and cos70 = - q

One of the questions was:find an expression for cos140

In the mark scheme the answer was:

cos^2(X) + sin^2(X) = 1 (I understand the importance of using the trig identity)

followed by: cos(140) = √(1 - sin^2(X)) (I got this far)

this is the bit which I do not understand which was in the mark scheme:

cos(140) = √(1 - p^2)

How does p = sin x ?

all the information that it gives is that p = sin40, so how can that be applied in general?