How to find colider steepness?

In my game i need to find current steepness of terrain. I was thinking to raycasting from 1 unit at front of capsulcoliders midle point downward and get hitpoint. Then i would compare hitpoint with capsulecoliders bottom and get degrees.
Are my thinking right? Or there are something better solution to get it done?

The normal property of the raycast result already gives you the normal of the surface it hit: Unity - Scripting API: RaycastHit.normal