This is perhaps a better question for mathematics SE, however, this deals more with the performance side of gaming, and software in general. When I say recursive function, I mean recurrence relation.
I figure, in theory, a recursive function for sine, cosine, and tangent, would provide a function that takes less time to execute, rather than calculating the individual sine, cosine, and tangent every single time, considering that most functions in a game are continuous that require sine and cosine or tangent, e.g. the camera in a 2D or 3D scene. Whenever the mouse is moved, we could use a previous metric of sine, cosine, or tangent to calculate the next value.
Do such recursive functions exist? I have done a quick Google search, but I couldn't really find anything, and I would not know how to formulate a recursive function with my current knowledge of mathematics. (There must be a recursive formula for every function of x that is, at least, continuous.)
Were there older approaches taken in older or even recent video games to achieve good-enough results, like quaternion rotation, to achieve a real-time result?
Some examples where this might potentially be an optimization:
- Any terrain generation algorithm. For example, Minecraft currently generates xyz 16-256-16 chunks. Instead of generating 16x16 or 16x256x16 chunks, you could generate individual blocks at a time as time passes or per tick. This would reduce the time per tick spent on generating terrain, and is relatively cheap as you could make it camera direction-dependent, e.g. generate blocks in the direction of the camera, and visible blocks can be generated first allowing lazy terrain generation. This would work with chunks of any size. The same could apply to vector terrain generation. However, relating to recurrence relation, said function would require (for Minecraft) one of 6 cardinal directions to calculate what the next block should be.
- Camera matrices. Despite the fact that you can move your mouse around to make the camera jump on-screen, the Camera function is effectively contiguous per frame. When there is entropy, the transitions are very smooth with about the same interval for each camera rotation, and even then, all movement is a paraboloid shape. This could allow for some optimization like iterative approximation as mentioned in the comments.
- Any algorithm that is inherently contiguous in software; interpolations; etc.