How do you calculate the angle of a ramp slope?

How do you calculate the slope of a ramp?
  1. slope[ratio] = rise : run.
  2. slope[angle] = arctan(rise/run)
  3. slope[%] = 100% * rise/run = 100% * tan(angle)

What is the ideal slope for a ramp?

In relation to the length of the ramp, for short distances—up to 1.5 meters—the slope should be less than 12%. For distances of up to 3 meters it must be less than 10%, and for distances of up to 9 meters, it should be less than 8%, always taking the above considerations regarding height into account.