util.rotate_position() has unintended behaviour. When rotating the vector {0, -4} (whch is pointing north) to 0.25 (east), I'd expect the result being {4, 0}, but it is returning {-4, 0}.
I think the problem might be due to the inverted y axis. When assuming cartesian coordinates where y values increase to the top (north), the result is correct, but in Factorio y values increase to the south.
Another small improvement request is to allow named x, y keys for the position in util.moveposition().
Also please allow orientation values in math2d.position.rotate_vector().
[boskid] util.rotateposition bug
-
Natha
- Filter Inserter

- Posts: 313
- Joined: Sun Mar 15, 2015 1:48 pm
- Contact:
- boskid
- Factorio Staff

- Posts: 4783
- Joined: Thu Dec 14, 2017 6:56 pm
- Contact:
Re: [boskid] util.rotateposition bug
Thanks for the report. util.rotate_position is now fixed for 2.0.43.