A line makes angle tan−17 and tan−135 with X -axis and Y -axis respectively.
So, α=tan−17 tanα=7 ⇒cosα=81
and β=tan−135 tanβ=35 ⇒cosβ=83
Let angle make with Z -axis is γ. So, cos2α+cos2β+cos2γ=1 ⇒(81)2+(83)+cos2γ=1 ⇒84+cos2γ=1 ⇒21+cos2γ=1 ⇒cos2γ=21 ⇒cosγ=±21 ⇒cosγ=21 or 2−1 ⇒γ=4π or π−4π ⇒γ=4π or 43π
So, angle made by line with Z -axis is 4π and 43π.