Answer
$a=24 \sin \theta$
and
$b=24 \cos \theta$
Work Step by Step
As we know that $\sin \theta=\dfrac{opposite}{hypotenuse}$
and $\cos \theta=\dfrac{adjacent}{hypotenuse}$
It can be seen from the given figure that
we have $\sin \theta= \dfrac{a}{24}$
This gives: $a=24 \sin \theta$
Now, $\cos \theta=\dfrac{b}{24}$
This gives:
$b=24 \cos \theta$