Comments (4)
@mgold normalize
would only return NaN for Vec2 0 0
, which is similar to dividing 0 by 0.
direction v1 v2
for any v1 == v2
would result in a Vec2 NaN NaN
.
Looking at the docs, I learned that NaN is a standardized part of floating point numbers. So I think that @w0rm is correct and perhaps these functions should remain as they are.
from linear-algebra.
It is possible to get a NaN in Elm numbers too by dividing two zeros. I don't think this should be implemented, because of the performance cost. I may be wrong though! Let's keep this issue to see what others think
from linear-algebra.
What vectors produce NaNs when given to these functions?
Would NaN be the appropriate direction of the zero vector?
from linear-algebra.
I faced this problem too in the physics engine that I'm building. I mitigated this by implementing almostZero
function
from linear-algebra.
Related Issues (10)
- Misses initializer for Matrix4 with all fields HOT 1
- Are there plans to support 2D transforms? HOT 3
- Is it possible to copy the issues elm-linear-algebra/issues? HOT 3
- 1.2.1 version breaks webgl program HOT 25
- Add pointwise mapping
- Convertors for Mat4 type HOT 6
- Use consistent type for native arrays HOT 4
- Vector4 setters produce incorrect results
- Question before making PR HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linear-algebra.