Tool/Calculator to find a slope/grade value (of a road, a roof, a construction, a frame, etc.) from its height or width or length or distance etc.

Slope Calculator - dCode

Tag(s) : Geometry

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!

A suggestion ? a feedback ? a bug ? an idea ? *Write to dCode*!

Slope is a measure of the inclination or decline of land, road or surface. It indicates the variation in height in relation to a distance traveled.

Slope is generally measured in percentage (a slope of 30%, or a rise/change of 30 units for a run horizontal distance of 100 units).

By extension, some call slope, the angle $ a $ (a slope of 15 degrees).

The slope $ p_\% $ (in % percent) is calculated by the ratio of the height $ h $ by the width $ w $ (multiplied by 100 to get a percentage): $$ p_\% = 100 \times \frac{h}{w} $$

__Example:__ Calculate the slope for a vertical distance of 10m and a horizontal distance of 50m: $ p = 10/50 = 0.2 $ or $ 20% $

The slope $ p° $ (in ° degrees) is calculated by trigonometric functions: $$ p° = \arctan \left( \frac{h}{w} \right) \times \frac{180}{\pi} $$

__Example:__ Calculate the slope for a vertical distance of 10m and a horizontal distance of 50m: $ p° = \arctan(10/50) \approx 0.19 \text{ rad} \approx 11.3° $ (multiply radians by $ 180/\pi $ to get a value in degrees)

The formula for converting slope from degrees to percentage is:$$ p° = \arctan \left( p_\% / 100 \right) \times \frac{180}{\pi} $$

The formula for converting slope from percentage to degrees is: $$ p_\% = 100 \tan( p° \times \frac{\pi}{180} ) $$

A positive slope (or grade) indicates that the land rise or is rising in the chosen direction (positive height difference), while a negative slope indicates that the land is falling or falling in the chosen direction (negative height difference).

A grade/slope of 0% means that there is no significant vertical change in the distance traveled. This is equivalent to flat land (no elevation).

The following equations allow us to find $ d $, $ h $, $ w $ from the angle $ a $ (in degrees)

$$ d = w / \cos(a \pi/180) $$

$$ h = d \sin(a\pi/180) = w \tan(a \pi/180) $$

$$ w = h / \tan(a \pi/180) $$

From the slope $ p_\% $ in percentage:

$$ d = w / \cos(\arctan( p_\% / 100 ) ) $$

$$ h = d \sin( \arctan( p_\% / 100 ) ) = w \tan( \arctan( p_\% / 100 ) ) $$

$$ w = h / \tan( \arctan( p_\% / 100 ) ) $$

dCode retains ownership of the "Slope Calculator" source code. Except explicit open source licence (indicated Creative Commons / free), the "Slope Calculator" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "Slope Calculator" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Slope Calculator" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!

Reminder : dCode is free to use.

The copy-paste of the page "Slope Calculator" or any of its results, is allowed (even for commercial purposes) as long as you credit dCode!

Exporting results as a .csv or .txt file is free by clicking on the *export* icon

Cite as source (bibliography):

*Slope Calculator* on dCode.fr [online website], retrieved on 2024-09-10,

slope,distance,height,width,inclination,elevation,grade,run,rise,angle

https://www.dcode.fr/slope-calculator

© 2024 dCode — El 'kit de herramientas' definitivo para resolver todos los juegos/acertijos/geocaching/CTF.

Feedback