(trig-functions-c)=
# Exercise 7: Trigonometric functions
**(15 minutes)**
The quantity theta, or the angle that the beam makes with the *z*-axis,
is calculated by:
$$
\theta = \arctan\left(\frac{p_{T}}{p_{z}}\right)
$$
The units are radians. Revise your script to include a histogram of
theta.
:::{admonition} I'll make your life a little easier
:class: note
The math function you want is `TMath::ATan2(y,x)`, which computes the
arctangent of y/x. It's better to use this function than
`TMath::ATan(y/x)`, because the `ATan2` function correctly handles the
case when *x*=0.
:::
:::{figure-md} los_alamos-fig
:class: align-center
by Randall Munroe
:::