12345678910111213141516171819 |
- local PI = 3.141592653589793
- local HALF_PI = PI * 0.5
- local mathsin = math.sin
- local mathcos = math.cos
- local function cos(x)
- if x % PI == HALF_PI then
- return 0
- end
- return mathcos(x)
- end
- local function sin(x)
- if x % PI == 0 then
- return 0
- end
- return mathsin(x)
- end
|