2 ms·
I often use this method: https://github.com/microsoft/DirectXMath/blob/83634c742a85d1027765af53fbe79506fd72e0c3/Inc/DirectXMathMisc.inl#L2158-L2193 https://gith
by Const-me 6y ago
I often use this method: https://github.com/microsoft/DirectXMath/blob/83634c742a85d1027765af53fbe79506fd72e0c3/Inc/DirectXMathMisc.inl#L2158-L2193 https://github.com/microsoft/DirectXMath/blob/83634c742a85d1...
Similar code with optional double precision support and more options: https://www.geometrictools.com/GTE/Mathematics/CosEstimate.h https://www.geometrictools.com/GTE/Mathematics/CosEstimate.h
If you don’t like C++, both of them are fairly simple to port to C.