The angle is based on the amount of space available, but is commonly determined by the rise and run of a stair. With a 7 inch riser and an 11 inch tread (this is usually a minimum) you get an angle of arctan(7/11) or 32 degrees. Most carpenters will simply use a framing square to figure this rather than doing trig.