3 ms·
If you need to use Vectors and Quaternions then Go isn't really for you either. The lack of any ability to do any operator overloading or writing arithmetic ty
by lamontcg 5y ago
If you need to use Vectors and Quaternions then Go isn't really for you either.
The lack of any ability to do any operator overloading or writing arithmetic types along with the lack of parameteric polymorphism means you wind up doing stuff like Q.VectorMult(v) instead of just Q * v.
Somewhere there's one of those "Go Koans" about how languages should allow programmers to easily express their intent, which I think the latter covers much better since nobody writes mathematical texts/articles using method notation.
Meanwhile Go has that whack and almost useless complex type built into the language because Rob Pike pulled it out of the ANSI C book and figured that was all the Engineers at Google would ever need to use, or something. But users can't write types like that because they can't be trusted with that much power I guess.
- usrn 5y agoI kind of like making that a method since matrix products are not associative.
- lamontcg 5y agoYou can determine that by the ordering of Q * v vs. v * Q though just like on paper or in any book. The method syntax isn't doing anything for comprehension. (Although it could really use a transpose operator as well and proper row and column vectors, but gamedevs are filthy savages)