by jrwatts » August 15th, 2020, 12:06 am
Actually, you would need Math.atan() and Math.toDegrees() for this application, but it should be possible. I believe Math.toDegrees(Math.atan((x2-x1)/(y2-y1))) would give you the number of degrees from vertical, if I'm getting my trigonometry right. The trick is how to get those coordinates into your formula....
Edit: And, of course, you'd have to worry about y2==y1, which would give you a divide-by-zero error....
So, probably do-able, but difficult.