411 reputation
211
bio website yeahbutisitart.com
location Scotland, United Kingdom
age 38
visits member for 3 years, 10 months
seen Sep 23 at 16:21

Jun
23
awarded  Yearling
Jun
23
answered Calculate laser bounce inside polygon
Jan
11
awarded  Popular Question
Feb
26
awarded  Nice Answer
Feb
26
revised Staggered Isometric Map: Calculate map coordinates for point on screen
Formatting
Feb
26
revised Staggered Isometric Map: Calculate map coordinates for point on screen
Added code example
Feb
17
comment What's the best way of transforming a 2D vector into the closest 8-way compass direction?
Removed magic constants from inline code.
Feb
17
revised What's the best way of transforming a 2D vector into the closest 8-way compass direction?
Remove magic numbers
Feb
15
comment What's the best way of transforming a 2D vector into the closest 8-way compass direction?
This is awesome, but makes a similar mistake to the one I made in my own attempt. The answers are close but not right. The boundary angle between E and NE is 22.5 degrees, but this cuts off at 26.6 degrees.
Feb
15
revised What's the best way of transforming a 2D vector into the closest 8-way compass direction?
Pedant filter
Feb
14
comment What's the best way of transforming a 2D vector into the closest 8-way compass direction?
Tweaked with proper numbers
Feb
14
revised What's the best way of transforming a 2D vector into the closest 8-way compass direction?
added 18 characters in body
Feb
14
comment What's the best way of transforming a 2D vector into the closest 8-way compass direction?
Yeah, 2 & 0.5 comes from splitting a square into equal segments along each edge instead of a circle. I'll tweak those figures..
Feb
14
answered What's the best way of transforming a 2D vector into the closest 8-way compass direction?
Feb
13
awarded  Yearling
Feb
13
revised What's the best way of transforming a 2D vector into the closest 8-way compass direction?
Clarify direction
Feb
13
comment What's the best way of transforming a 2D vector into the closest 8-way compass direction?
Sorry, I hid that in the title. Should have been clearer in the question body
Feb
13
comment What's the best way of transforming a 2D vector into the closest 8-way compass direction?
Sorry, but that won't give exactly the answer I'm looking for. With that code it will only yield "N" if the vector is precisely north, and NE or NW if x is any other value. What I need is the closest compass direction, e.g. if the vector is closer to N than NW then it will yield N.
Feb
13
awarded  Commentator
Feb
13
comment What's the best way of transforming a 2D vector into the closest 8-way compass direction?
Either, since it will be used both ways :) Though if I had to pick, I'd take a string.