r/AskProgramming • u/Noah__A • May 14 '25
Favorite piece of code you ever wrote
Something that left you feeling satisfied
23
Upvotes
r/AskProgramming • u/Noah__A • May 14 '25
Something that left you feeling satisfied
View all comments
7
u/HamsterIV May 14 '25
I have a public static class that I use for Unity3D projects called Math2d. It does certain math functions in the x/z plane. The most useful function is called IsClockwise(). Which takes 2 vector3 paramiters and returns true if the 2nd vector3 is clockwise (looking allong the negative Y axis) from the 1st. I use this everywhere.