-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why does Point
exist?
#502
Comments
I think traditionally having Point be distinct from Vector is an effort to encode the distinction between affine spaces and euclidean spaces into the type system. This is usually done to prevent certain types of bugs (for example adding two points together is invalid, but subtracting them is perfectly fine). I think the graphics community is somewhat split on this topic because each choice has its tradeoffs. FWIW I think that |
I see. Well, I guess I'll create a PR for that. |
When I switched to cgmath I expected the distinction between |
Just wanted to explicitly chime in here to say that your feedback is much welcome, and I agree that the niche for rich typing is already taken, and we can have |
Just to throw my opinion out there, too: I very much appreciate the distinction between Instead of thinking about removing |
@LukasKalbertodt it really comes down to what niche If you truly care, help with reviews and code cleanup, API shaping for 0.18. Would be interesting to see some basic analysis on what other libraries expose in terms of vector-point distinction. |
I agree overall that |
The conversion is kind of here. Thanks to points implementing Not only that, I see no benefit in having |
I've been re-reading the docs for
cgmath
and I honestly don't understand why there are bothVector
andPoint
in the library.In pure maths these two concepts are barely distinguished, while in
cgmath
they are strictly split by introducing twostruct
s. Not only that, these structs have different functionality implemented for them which consequently makes the crate more complicated. What was the motivation behind that partition?P.S.
I personally feel like all the functionality for
Vector
andPoint
should be implemented for one struct ---Vector
(andPoint
should be depreacted). That will drastically simplify the crate and can fix issue #501. I can send a PRThe text was updated successfully, but these errors were encountered: