You should apply this to a floor equation So like, the floor equation could be Y=100+SIN(X/60+1) Then the angle of the floor would be -1 divided by the derivative of the equation In this case ANGLE=-60/COS(X/60+1)