phetsims / dot

A math library with a focus on mutable and immutable linear algebra for 2D and 3D applications.
http://scenerystack.org/
MIT License
13 stars 6 forks source link

Should Vectors support NaN? #111

Closed zepumph closed 3 years ago

zepumph commented 3 years ago

From https://github.com/phetsims/tandem/issues/246:

Vector2 supports NaN but Vector2IO doesn't. Should that be rectified, either by removing NaN from Vector2 support or by adding NaN support to NumberIO?

I don't feel strongly, but I can't understand why we wouldn't want to immediately assert out in a case where you try to set to NaN. Marking for dev meeting for a quick convo.

jbphet commented 3 years ago

This was discussed in the 10/12/2021 developer meeting, and we decided to close this with no action. We're still not going to support it in serialization, but there may be some cases where we want to support NaN and infinities, especially as intermediate calculation steps, while working with vectors, so we don't want to limit ourselves. We shouldn't attempt to serialize vectors with NaN or infinities though, so not supporting serialization of these values is cool. Closing.