Trigonometric Functions in Pseudo Code
I'm searching for Trigonometric Functions in Pseudo Code. I'm Not good at mathematics, so I can't do much with the formulas in the Wikipedia. Mainly I'm searching for Sine, Cosine, Tangent and the inverse functions (sin⁻¹, cos⁻¹, tan⁻¹) of them. There are also other Trigonometric Functions. But for me the above are the most important. If it is possible, I would be happy if in the pseudo code only variables, for, if, and operators (+, -, *, /, %, sqrt()) are used, because I do not have a library with advanced mathematics functions.
Trigonometry functions are Transcendental. You cannot find an exact expression of them in term of polynomial algebra. You can approximate them though. The usual approach is to use periodicity and symmetry to reduce an angle α into and equivalent angle α′ such that sin(α) = sin(α′) but α′ ≪ α. Simply put you reduce any angle into and angle in the first quadrant or similar, this is easier than it looks. Once you have a small angle, you can use Taylor Series Expansion to compute the function up to a fixed error magnitude. Here is a tutorial page. Another approach is to use a lookup table. This is especially useful when you can keep track of the required precision of the process and is very fast. However it takes more memory and may give rise to a step-looking function. Here an introductory page. Another approach is to use CORDIC Algorithm, this is specially suited for hardware that lacks multiplication support (like some MIPS and ARM chips). From Wikipedia: CORDIC is generally faster than other approaches when a hardware multiplier is not available (e.g., a microcontroller) [...] On the other hand, when a hardware multiplier is available (e.g., in a DSP microprocessor), table-lookup methods and power series are generally faster than CORDIC.
How to compute sum of angles from sine and cossine?
Counting trig ops as measure() function to fu() in sympy
Find a coordinate along a path
Angle calculation resulting in strange behavior
Shift angle orientation using atan2
estimate angle between two lines y = 1000x and y = 999x
Need help revising a simple formula to make it universal
SWIFT trig functions
2 Different Radians constant calcuations whats the difference?
Trigonometry & Sunset
Calculating collisions with Radians incrementing
How do arbitrary-precision libraries like mpmath evaluate simple trigonometric functions?
How can I calculate the angle
Finding Shortest Distance Between Two Parallel Lines, With Arbitrary Point [closed]
how to convert depth in Z-cordinate