I was wondering if someone could help me out with how to change a cosine into fractional from: example cos 45 = sqrt2/2 and cos 150 = sqrt3/2

I know that if I take the inverse of the cosine decimal form I can take the answer do square it, make a fraction out of it with the sqrt of the square dived by the squared number. that gets really messy as well though.