Conversion of a delta pair to degree's
Undoubtedly this question has been asked before, except I completely lack the knowledge to find it.

I'm trying to write the classic snake (aka Nibbles) game and the logic is pretty straight forward.  Direction is expressed by a delta coordinate pair.  North is -1, 0; east is 0, 1; south is 1,0; and west is 0, -1.

It's been a decade since I took a math course so I'm not exactly sure how to convert those pairs into something where North = 0 degree's; east = 45, south = 90; and west = 135 in which case the problem is drastically simple and becomes a case of clock arithmetic then conversion back to delta pairs.

Also, this is not academic homework but [self-education](https://github.com/devdave/Ping---canvas-helper-library)
Conversion of a delta pair to degree's
===

Undoubtedly this question has been asked before, except I completely lack the knowledge to find it.

I'm trying to write the classic snake (aka Nibbles) game and the logic is pretty straight forward.  Direction is expressed by a delta coordinate pair.  North is -1, 0; east is 0, 1; south is 1,0; and west is 0, -1.

It's been a decade since I took a math course so I'm not exactly sure how to convert those pairs into something where North = 0 degree's; east = 45, south = 90; and west = 135 in which case the problem is drastically simple and becomes a case of clock arithmetic then conversion back to delta pairs.

Also, this is not academic homework but [self-education](https://github.com/devdave/Ping---canvas-helper-library)