Conversion from Equatorial Coordinate to Horizon Coordinates
It depends from which celestial coordinates you are converting. I suppose you are working in equatorial coordinates. Then, you can convert as following:

$$\tan A = {\sin h \over \cos h \sin\phi_o - \tan\delta \cos\phi_o} $$ $$ \begin{cases}
 \cos a \sin A = \cos\delta \sin h \\
 \cos a \cos A =  \cos\delta \cos h \sin\phi_o - \sin\delta \cos\phi_o
\end{cases}$$ $$\sin a = \sin\phi_o \sin\delta + \cos\phi_o \cos\delta \cos h$$

Where $A$ is azimuth, $a$ altitude, $\alpha$ right ascension, $\delta$ declination, $h$ hour angle and $\phi_0$ the observer's latitude.

Source: Wikipedia