Angles are incorrect? Solved, Incorrect trig

I have some basic pixel art that is using a 67.5* slope. (Which is just a 1/2 slope, y = 1/2 x)

I’m trying to create some pivot points and have noticed that the angles in unity don’t line up correctly?
The slopes don’t line up how I would imagine they would, and am wondering what anyone thinks is the issue.

I can only assume this is a bug, but if not I’m sorry.

9816156--1410507--upload_2024-5-5_20-4-12.png

Er, no, not quite.

EDIT: I boofed my trig too…

Tangent is rise over run… two pickles over, one pickle up, so slope of 0.5

atan (0.5f) ==> 26.56 degrees

Or measuring if zero is straight up, it would be 63.44 degrees

with atan() being of course inverse of tan()

(remember also the trig methods ALL work in radians, not degrees!!)

Mathf.Rad2Deg and Mathf.Deg2Rad are your best friends.

The angles check out on a 2x1 cube with a diagonal line (via cylinder) at 63.44 degrees.

9816342--1410591--Screen Shot 2024-05-05 at 9.13.21 PM.png 9816342--1410594--Screen Shot 2024-05-05 at 9.11.12 PM.png

1 Like

Huh… that’s embarrassing on my part.

Thank you for your help, I was starting to go crazy.

1 Like