52ky 发表于 2022-10-4 09:33:23

简单,快速,精准的sin/cos函数模拟,及as3实现

在某些状况下我们需求一些更高效的且近似于规范值的sin和cos函数。有时候我们并需求过高的精度,这时C语言中自带的三角函数(sinf()和cosf()f)计算的精度超出了我们所需求的精度请求,所以其效率很低。我们真正需求的是间于精度和效率的一个折中的方案。众所周知的取近似值的方法是:泰勒级数(和著名的马克劳林级数)代码是:x-1/6x^3+1/120x^5-1/5040x^7+...在这里介绍一种运算快,简单的方法。
一种简单,快速,精准的sincos函数模拟,及as3实现.doc

(In some cases, we need more efficient sin and cos functions that are close to the specification value. Sometimes we also need high precision. At this time, the precision of trigonometric functions (sinf() and cosf() f) in C language exceeds the precision we need, so its efficiency is very low. What we really need is a compromise between precision and efficiency. It is well known that the approximation method is: the code of Taylor series (and the famous Marklaurin series) is: x-1/6x ^ 3 1/120x ^ 5-1/5040x ^ 7 ... Here we introduce a fast and simple method.
A simple, fast and accurate simulation of sincos function, and as3 implementation. doc)




页: [1]
查看完整版本: 简单,快速,精准的sin/cos函数模拟,及as3实现