Skip to content
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

Closed
nical opened this issue Aug 19, 2016 · 8 comments
Closed

Proposal: Rename Matrix4D #160

nical opened this issue Aug 19, 2016 · 8 comments

Comments

@nical
Copy link
Contributor

nical commented Aug 19, 2016

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:

  • AffineTransform3D (I am not a fan of this one)
  • Transform3D

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

@metajack
Copy link
Contributor

Why don't we name it Matrix4 and Matrix3 and drop the D entirely?

On Friday, August 19, 2016, Nicolas Silva [email protected] wrote:

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 #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:

  • AffineTransform3D (I am not a fan of this one)
  • Transform3D

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 https://github.com/nox @peterjoel https://github.com/peterjoel


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#160, or mute the thread
https://github.com/notifications/unsubscribe-auth/AABuxdyznn1rR5N-GqCfgZFngsulxUY-ks5qhZWFgaJpZM4JoZI6
.

@nical
Copy link
Contributor Author

nical commented Aug 20, 2016

Matrix3 would be the 2x3 matrix?
Would that mean Rename Point2D in Point2 (etc.) as well ?

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.

@metajack
Copy link
Contributor

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?

@nical
Copy link
Contributor Author

nical commented Aug 22, 2016

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).

@Manishearth
Copy link
Member

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.

@nical
Copy link
Contributor Author

nical commented Sep 6, 2016

Transform3D is my favorite option at the moment. I don't think there is value in being more technical.

@kvark
Copy link
Member

kvark commented Feb 10, 2017

I also (independently) came to a conclusion (in #159 (comment)) that Transform3D is the way, together with Point/Vector separation.

@nox
Copy link
Contributor

nox commented Mar 4, 2017

@nical @kvark @pcwalton @glennw Let's do this before the quarter finishes.

bors-servo pushed a commit that referenced this issue May 21, 2017
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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants