Rotation Matrix given angle and point in X,Y,Z

The complete rotation matrices are derived and given at https://sites.google.com/site/glennmurray/glenn-murray-ph-d/rotation-matrices-and-formulas/rotation-about-an-arbitrary-axis-in-3-dimensions. From the paper: 5.2 The simplified matrix for rotations about the origin Note this assumes that (u, v, w) is a direction vector for the axis of rotation and that u^2 + v^2 + w^2 = 1. If you have a point (x, y, z) … Read more

How are exponents calculated?

I’ve had a chance to look at fdlibm’s implementation. The comments describe the algorithm used: * n * Method: Let x = 2 * (1+f) * 1. Compute and return log2(x) in two pieces: * log2(x) = w1 + w2, * where w1 has 53-24 = 29 bit trailing zeros. * 2. Perform y*log2(x) = … Read more

how to calculate reverse modulus

private int ReverseModulus(int div, int a, int remainder) { if(remainder >= div) throw new ArgumentException(“Remainder cannot be greater than or equal to divisor”); if(a < remainder) return remainder – a; return div + remainder – a; } e.g. : // (53 + x) % 62 = 44 var res = ReverseModulus(62,53,44); // res = 53 … Read more