-
Notifications
You must be signed in to change notification settings - Fork 103
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
Proposal: Rename Matrix4D #160
Comments
Why don't we name it Matrix4 and Matrix3 and drop the D entirely? On Friday, August 19, 2016, Nicolas Silva [email protected] wrote:
|
Matrix3 would be the 2x3 matrix? I have a preference towards naming things after what they do (2d vs 3d transformations) rather than what they look like in memory, but if we decide to do the latter (which is also a sensible thing to do) I would prefer to make in unambiguous and consistent: Matrix2x3 (or is Matrix3x2), Matrix4x4, Point2, Vector2, Point3, Vector3, etc. |
I was under the incorrect impression that Matrix2D was 3x3. My suggestion makes less sense with that info. I think I'm fine with Matrix4D renamed to Matrix3D in that case. Out of curiosity, why is Matrix2D a 3x2? |
Matrix2D is 3x2 because a 2x2 matrices can not represent translations. It could be 3x3 but the extra components would not help expressing any transformation we care about (there's no perspective and other funky projections that make sense in 2D). |
I like Transform3D better. Or Tensor3D if you want to get technical. Matrix is the representation, and is 4D. It could have been represented in other ways too. But what it is is a 3D transform (technically, a rank-2 tensor in a 3d vector space), represented in some way. |
Transform3D is my favorite option at the moment. I don't think there is value in being more technical. |
I also (independently) came to a conclusion (in #159 (comment)) that |
Rename Matrix2D/4D into Transform2D/3D Fixes #160. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/euclid/194) <!-- Reviewable:end -->
Matrix4D is a 4 by 4 matrix for 3D transformations.
The "4D" in the name apparently comes from the 4 by 4 matrix layout, but besides that Matrix2D is a 2 by 3 matrix for 2D transformations.
In the pull request #151 I am removing Point4D, leaving us with Matrix4D as the only 4D-labelled thing in euclid.
I am proposing that we rename Matrix4D into Matrix3D, so that the name reflects what type of operations we are doing, rather than the internal layout of the matrix.
There are also suggestions such as:
Thoughts? This is really just about the name, not the implementation. Since I am pushing a series of breaking changes, now is a good time to bikeshed about aesthetics (I wouldn't want to go through all of servo just to fix names).
cc @nox @peterjoel
The text was updated successfully, but these errors were encountered: