Skip to content

Add cast and to_* methods to Translation2D/Translation3D #506

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

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

ids1024
Copy link
Contributor

@ids1024 ids1024 commented Sep 20, 2023

Matches definitions that exist for Vector2D/Vector3D.

These methods seem as applicable to "translations" as to "vectors". A space may have coordinates in different types, and conversion may be necessary.

Matches definitions that exist for `Vector2D`/`Vector3D`.

These methods seem as applicable to "translations" as to "vectors".
A space may have coordinates in different types, and conversion may be
necessary.
Copy link
Contributor

@nical nical left a comment

Choose a reason for hiding this comment

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

LGTM

ids1024 added a commit to ids1024/euclid that referenced this pull request Sep 25, 2023
Like servo#506, these exist for the
vector types. There doesn't seem to be any reason there shouldn't also
work for translation types.

The existing `translate` methods could be used for subtraction with
`inv`, but that requires a complicated bound involving `Inv` and `Add`
instead of a `Sub` bound.
@nical nical added this pull request to the merge queue Sep 28, 2023
Merged via the queue into servo:master with commit d99c995 Sep 28, 2023
ids1024 added a commit to ids1024/euclid that referenced this pull request Oct 14, 2023
Like servo#506, these exist for the
vector types. There doesn't seem to be any reason there shouldn't also
work for translation types.

The existing `translate` methods could be used for subtraction with
`inv`, but that requires a complicated bound involving `Inv` and `Add`
instead of a `Sub` bound.
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

Successfully merging this pull request may close these issues.

2 participants