excaliburjs / Excalibur

🎮 Your friendly TypeScript 2D game engine for the web 🗡️
https://excaliburjs.com
BSD 2-Clause "Simplified" License
1.77k stars 189 forks source link

Proposal: rename or alias Vector.size to Vector.magnitude #3165

Closed mattjennings closed 1 month ago

mattjennings commented 1 month ago

Context

This is something that I repeatedly get tripped up on. It seems best to match Vector properties/methods to their mathematical operation. In Excalibur that's mostly true except magnitude is size, and I always forget. Most vector libraries also seem to name their magnitude property/method as magnitude

Proposal

Deprecate size in favour of magnitude

eonarheim commented 1 month ago

@mattjennings totally agree