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

Implement toFieldAligned and fromFieldAligned for Vector3D #1877

Merged
merged 7 commits into from
Feb 4, 2020

Conversation

johnomotani
Copy link
Contributor

@johnomotani johnomotani commented Jan 2, 2020

We found a case where we needed toFieldAligned() and fromFieldAligned() for a Vector3D, so implemented them.

@johnomotani johnomotani added feature small-change Changes less than 100 lines - should be quick to review backport candidiate Does not break backward compatibility, so can be back-ported to v4.4 labels Jan 2, 2020
@ZedThree
Copy link
Member

ZedThree commented Jan 6, 2020

Should we also add it for Vector2D?

Also, you can drop the const from the return type. We currently have it in lots of places, but we should probably remove it, as I don't think it's ever helpful. Looks like clang-tidy can even do so for us.

Vector3D result;
result.setLocation(v.getLocation());
if (not v.covariant) {
result.toContravariant();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably should have an emptyFrom and zeroFrom for vectors, like for fields.

bendudson
bendudson previously approved these changes Jan 10, 2020
ZedThree
ZedThree previously approved these changes Jan 10, 2020
@ZedThree ZedThree merged commit 7acd841 into next Feb 4, 2020
@ZedThree ZedThree deleted the vector-tofromFieldAligned branch February 4, 2020 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport candidiate Does not break backward compatibility, so can be back-ported to v4.4 feature small-change Changes less than 100 lines - should be quick to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants