2 ms·
A similar old trick that both swaps x with y and negates y: x -= y // x-y, y y += x // x-y, x x -= y // -y, x If (x, y) represents a 2d vector th
by tzs 5y ago
A similar old trick that both swaps x with y and negates y:
x -= y // x-y, y
y += x // x-y, x
x -= y // -y, x
If (x, y) represents a 2d vector this operation rotates the vector counterclockwise 90°.
- xxs 5y agodoesn't work with floats, due to NaN, infinity