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

Should Vector2D<T,U>::length() return Length<T,U> #396

Open
btrepp opened this issue Jan 23, 2020 · 1 comment · May be fixed by #461
Open

Should Vector2D<T,U>::length() return Length<T,U> #396

btrepp opened this issue Jan 23, 2020 · 1 comment · May be fixed by #461

Comments

@btrepp
Copy link

btrepp commented Jan 23, 2020

Not sure If I'm misunderstanding something, but shouldn't this try and preserve the unit?.
It's easy enough to handle, in your own code, but I did like the strong types this library provided.

@btrepp btrepp changed the title Vector2D<T,U>::length should return Length<T,U> Should Vector2D<T,U>::length() return Length<T,U> Jan 23, 2020
@nical
Copy link
Contributor

nical commented Jan 24, 2020

In practice we found out that people often don't use the units much when dealing with the scalar values (while they do with vectors and other types), so we want to have the default set of common accessors like x,y,length work with raw scalars. We even had *_typed() equivalents for all methods that return scalars but it was apparently too cumbersome to be used in practice so they were removed a little while ago.

I'm keen on adding them back with a less awkward naming scheme, for example get_length(&self) -> Length<T, U>, get_x(&self) -> Length<T, U>, etc. See also #388.

@kvark kvark mentioned this issue Jul 27, 2020
@nical nical linked a pull request Jul 28, 2020 that will close this issue
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 a pull request may close this issue.

2 participants