If refractive index is n,
n= sin i / sin r
where i = angle of incidence
r = angle of refraction
As joinedup has advised, substitute 90 degrees for r, and the equations wll give you angles of incidence (iin this case of TIR these are the critical agles, i.e. the smallest angle of of incidence that will lead to the ray being reflected rather than transmitted).