Couldn't find anything really useful for my needs. So if I already know my 2 variables x(Rise) and y(Run), and I want the slope in degrees, what is the best way to go about coding this? And how would you开发者_Python百科 format a textfield for the answer?
simplest is just to use
double slope = atan2(rise, run)*180/M_PI_2;
精彩评论