This detects the steepness of a slope - how far the y moves when the x changes by 1 - and the angle it makes with the x axis. This is my most accurate and efficient slope detector to date. Use the arrow keys to rotate the line. This method uses a semicircle of 36 points to determine the angle. The true/false values of each of the 36 points touching the line are stored in a list and then the gradient is worked out from a list of all the angles of the points.
All code by me. I had to learn trigonometry in one Saturday morning to do this. It wasn't too difficult. #slope #trig #trigonometric #trigonometry #gradient #maths #steepness #efficient