Rotating a Vector in 3D Space

If you want to rotate a vector you should construct what is known as a rotation matrix. Rotation in 2D Say you want to rotate a vector or a point by θ, then trigonometry states that the new coordinates are To demo this, let’s take the cardinal axes X and Y; when we rotate the X-axis 90° counter-clockwise, … Read more

Identity matrix in Julia

Given using LinearAlgebra, the most julianic way of expressing the identity matrix is: This answer may seem trite, but it is also kind of profound. The whole point of the operator I is that in the vast majority of cases where users want an identity matrix, it is not necessary to actually instantiate that matrix. Let’s say you want … Read more

What are the most widely used C++ vector/matrix math/linear algebra libraries, and their cost and benefit tradeoffs?

There are quite a few projects that have settled on the Generic Graphics Toolkit for this. The GMTL in there is nice – it’s quite small, very functional, and been used widely enough to be very reliable. OpenSG, VRJuggler, and other projects have all switched to using this instead of their own hand-rolled vertor/matrix math. I’ve found … Read more