Closed Zyl9393 closed 5 years ago
Thanks for fixing the issues I raised!
One thing that occured to me as I go to merge it:
How about LenSquared
as the name of the function? Then if you're using an editor with autocomplete, it will show up as you're looking for Len
- improving the discoverability. Also it would appear next to Len
in the documentation: https://godoc.org/github.com/go-gl/mathgl/mgl32
Let me know what you think. Happy to accept it as is otherwise - though I will squash the history down to just "Add ... functions", to avoid the merge commit going from master into the development branch.
I would expect autocomplete to list the function regardless of where in the name the substring is found, but regarding the documentation, you raise a good point. Maybe call it LenSqr
then, or LenSq
even? Having it short was one of main reasons for making this, and Sq
is a well understood shortcut in anything math-related; even Java refrains from its usual verbosity, calling the square root function in its Math package sqrt
.
OK, then :+1: to LenSqr
from me.
Should be good now.
Added SqrLen() functions which return squared vector length. This can make some lines shorter when variable names are long, e.g.:
worldSpaceFragmentCenter.Dot(worldSpaceFragmentCenter)
vs.worldSpaceFragmentCenter.SqrLen()
Understandable if not wanted, though. Mostly learning how 2 github over here. Have a nice day.