Comments (2)
Computing the matrix on-the-fly based on the angle would make applying the rotation to a point/vector quite expensive. Storing the matrix sin/cos in Rotation2
is a deliberate choice to optimize for this particular use-case. If benchmarks show that there is a need to cache this angle value, then it makes sense to leave it up to the user.
from nalgebra.
@sebcrozet, I'm not sure if I understand your point correctly. It would seem that if you start with an angle, and want to apply the rotation to a point/vector, then you would need to pay the cost of converting to sin/cos at some point (either when you create the Rotation2
instance, or when you apply the rotation). It can also be the case that you want to work only with the angle, and don't ever need to compute the sin/cos values. The point is to lazily compute (and cache) either angle or sin/cos as needed, but to avoid computing it if not needed.
Let me know if it would be helpful / worthwhile to submit a PR that demonstrates the idea.
from nalgebra.
Related Issues (20)
- matrix literals or const constructors HOT 1
- `normalize` docs need expansion HOT 1
- Test flake in `f64::symmetric_eigen`
- Unit Quaternion logarithm inconsistent with exp HOT 1
- Matrix Views: non contiguous/regular slices
- Minimizing trait bound complexity when working with dimensional generics HOT 3
- SVD Computes Wrong Singular Values for Very Small-Valued Matrices HOT 1
- Make nalgebra_lapack::qr::QRScalar trait public
- Homographic transform via SVD/DLT - is it broken or am I doing it wrong?
- Inconsistency between Numpy/MATLAB and and nalgebra HOT 2
- Export crates used in public APIs
- unit quaternions and orthonormal matrices are only closed under successive multiplications in theory HOT 1
- Memory leak in generic_resize/reallocate_copy
- Inverting a 4x4 matrix with `try_inverse_mut` doesn't leave `self` unchanged if the inversion fails.
- Numerically vulnerable axis calculation in Rotation3
- How to construct a symmetric matrix in nalgebra? HOT 3
- `from_iter` implementation may run indefinitely HOT 8
- Request: Allow the multiplication of matrices of matrices
- Owned MatrixView Lifetime issues
- GAT in Allocator Trait HOT 2
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 nalgebra.