gwg/vec
2
3
Fork
You've already forked vec
4

main #2

Merged
NNB merged 2 commits from vistuleB/vec-fork:main into main 2025年12月30日 16:31:51 +01:00
Contributor
Copy link

I fixed some English-as-a-second language problems in the README & added 'norm' as an alias for 'length' in vec2i/vec2f/vec3i/vec3f/vec4i/vec4f.

I fixed some English-as-a-second language problems in the README & added 'norm' as an alias for 'length' in vec2i/vec2f/vec3i/vec3f/vec4i/vec4f.
Owner
Copy link

Hi, thank you for the PR <3.

I will merge the "fixed some English-as-a-second language problems in the README".

But I have some question about the norm alias for length. I have never seen norm as a value/function to get vector's length, And I have checked Godot, Bevy, Phazer and Kaplay but none of them have norm as a way to get its length.

The name seem like an acronym of some word. I want to avoid acronym, seem like Gleam standard is to avoid acronym (even abs is int.absolute_value in Gleam).

Also, the name might get confuse with normalize functions (Normalize the vector).

Oh, and another thing, I think we should avoid alias as much as possible, to keep the API simple and avoid "too many ways to do the same thing".

But maybe there is something that I don't yet know or understand here. If anything, let me know ^^.

Hi, thank you for the PR <3. I will merge the "fixed some English-as-a-second language problems in the README". But I have some question about the `norm` alias for `length`. I have never seen `norm` as a value/function to get vector's length, And I have checked Godot, Bevy, Phazer and Kaplay but none of them have `norm` as a way to get its length. The name seem like an acronym of some word. I want to avoid acronym, seem like Gleam standard is to avoid acronym (even `abs` is `int.absolute_value` in Gleam). Also, the name might get confuse with [`normalize` functions (Normalize the vector)](https://hexdocs.pm/vec/vec/vec2f.html#normalize). Oh, and another thing, I think we should avoid alias as much as possible, to keep the API simple and avoid "too many ways to do the same thing". But maybe there is something that I don't yet know or understand here. If anything, let me know ^^.
Author
Contributor
Copy link

Just google "what is the norm of a vector" ;)

More seriously this a question of academic terminology versus game dev terminology. Some game dev engines try to keep words as "baby" as possible in order not to scare people away. But in a physics or math textbook the term "norm" is used.

Another example is the numpy library that uses the term "norm".
https://numpy.org/devdocs/reference/generated/numpy.linalg.vector_norm.html

Anyway "norm" is not an acronym, it's an ordinary word of the English language which is the math/physics term for "length of a vector".

Just google "what is the norm of a vector" ;) More seriously this a question of academic terminology versus game dev terminology. Some game dev engines try to keep words as "baby" as possible in order not to scare people away. But in a physics or math textbook the term "norm" is used. Another example is the numpy library that uses the term "norm". https://numpy.org/devdocs/reference/generated/numpy.linalg.vector_norm.html Anyway "norm" is not an acronym, it's an ordinary word of the English language which is the math/physics term for "length of a vector".
Owner
Copy link

Oh okay. I understand but these two point are still remain:

Also, the name might get confuse with normalize functions (Normalize the vector).

I think we should avoid alias as much as possible, to keep the API simple and avoid "too many ways to do the same thing".

So... sorry, I cant merge this PR yet. I think this PR should only be about fixing the README.md, then we can open a new issue to discuss this further.

Thanks!

Oh okay. I understand but these two point are still remain: > Also, the name might get confuse with [`normalize` functions (Normalize the vector)](https://hexdocs.pm/vec/vec/vec2f.html#normalize). > I think we should avoid alias as much as possible, to keep the API simple and avoid "too many ways to do the same thing". So... sorry, I cant merge this PR yet. I think this PR should only be about fixing the README.md, then we can open a new issue to discuss this further. Thanks!
Author
Contributor
Copy link

Hi thanks.

I understand the second point about keeping the API minimal and not wanting different names for different things. This is a valid aesthetic point.

Just FYI, for the "normalize" thing, "normalize" is a verb whereas "norm" is a noun. For a native English-speaking person (let alone someone with background in math&phys) there is no danger of confusion there. (Also norm has a different return type than normalize, thankfully.)

I will try to use your library without the norm, and get used to length :) I hope to build a 4x4 matrix library on top of it, at some point. (In separate package.)

Hi thanks. I understand the second point about keeping the API minimal and not wanting different names for different things. This is a valid aesthetic point. Just FYI, for the "normalize" thing, "normalize" is a verb whereas "norm" is a noun. For a native English-speaking person (let alone someone with background in math&phys) there is no danger of confusion there. (Also `norm` has a different return type than `normalize`, thankfully.) I will try to use your library without the `norm`, and get used to `length` :) I hope to build a 4x4 matrix library on top of it, at some point. (In separate package.)
Owner
Copy link

Okay, I love to see the matrix library in future!

Okay, I love to see the matrix library in future!
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
gwg/vec!2
Reference in a new issue
gwg/vec
No description provided.
Delete branch "vistuleB/vec-fork:main"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?