News for hackers. Stuff that matters.
Re:Show HN: Axis - a React.js multiplayer math game by NH_2 on Tuesday November 18, 2014 @11:59PM (#8628365)
Someone just rocked me with a step function. I'm intrigued.
Re:Show HN: Axis - a React.js multiplayer math game by svckr on Wednesday November 19, 2014 @04:34AM (#8629047)
That surprised me as well.

After some thinking I came up with min and max. If, for example, I want to change direction after x==4 I can do use

    -1.5(max(x,4)-4)
    
    0    4
    -----,
          \
           \
Maybe there are more tricks like that?
Re:Show HN: Axis - a React.js multiplayer math game by dmak on Wednesday November 19, 2014 @07:31AM (#8629621)
I am not sure if this is a step function, but I saw someone pretty much do an octagon shape to hit someone. How?
Re:Show HN: Axis - a React.js multiplayer math game by madez on Wednesday November 19, 2014 @11:59AM (#8631129)
(x+1) * max(0, sign(x)) * (1-max(0, sign(x-1/sqrt(2)))) + (1+1/sqrt(2)) * (1-max(0, sign(x-1/sqrt(2)-1))) * max(0, sign(x-1/sqrt(2))) + (-x+sqrt(2)+2) * max(0, sign(x-1/sqrt(2)-1)) * (1-max(0, sign(x-sqrt(2)-1)))