Determinant
determinant is the function that associates a scalar value det(A) to the square nxn matrix A.in computer computations it can be easily computated using LU matrix decomposition. but, ive made "quick and dirty" implementation of matrix determinant definition, just to see how it works. just to refresh memory, determinant of square nxn matrix A can be expressed using determinant expansion by minors :


matrix size : 2x2 matrices count : 3
matrix size : 3x3 matrices count : 10
matrix size : 4x4 matrices count : 41
matrix size : 5x5 matrices count : 206
.
matrix size : 8x8 matrices count : 69281
.
matrix size : 10x10 matrices count : 6235301
matrix size : 11x11 matrices count : 68588312
code of my "quick and dirty" can be taken from here : det.c
Complex arithmetics
today something about generating Mandelbrot like fractals - that is about complex numbers arithmetics. to generate classical Mandelbrot fractal we need only multiplication and addition of complex numbers. but we would like to have possibility to generate fractals defined with much more complicated equations (for example skull fractal). to achive this we need to define not only simple complex arithmetics, but also other operations (square root, power functions ) and functions (logarithmic, trigonometric... ).
derivations of all formulas can be found
HERE.
to make calculations even faster i suggest using assember and math coprocessor (described in "the art of assembler programming").
currently there are described functions : exp, ln, log2, logN, sin, cos, tan, sinh, cosh, tanh, pow
i have already implemented them using assember and fpu instructions, and all of them are about 30%-40% faster.
rotating objects around given line
if one wants to rotate objects around specified line in the space, one will have to gine two different points lying on that line. what is equivalent to giving normalized vector in the space. in OpenGl there are two ways of doing this :
1. transform coordinate system, so that one of its axis coincides with rotatation line. aftewards one will rotate object around selected axis, one that is coincide with rotation line
2. transform whole object, so that rotation can be realized without transforming the coordinate system
[read more]
1