Thread: Mapping Math
View Single Post
Old 04-22-2006, 08:52 AM   #12
PipeDream
Moderator
 
PipeDream's Avatar


Code Moderator
 
Join Date: Feb 2006
Posts: 1,405

Submissions (6)

PipeDream is a glorious beacon of light (463)PipeDream is a glorious beacon of light (463)PipeDream is a glorious beacon of light (463)PipeDream is a glorious beacon of light (463)

Default

Vuen, if blizzard really wanted fast trig, they could do tables. Especially easy because we only have single precision. Anyway, Cos/Sin are fast enough as is- they execute in less than 2us on my 1.6GHzish machine. I think most of that time is the interpreter..
As a side note I think the way the C++ stdlib does it is by transforming first to 0 to pi/2, doing a couple 3rd 5th or 7th angle formulas and then two or three taylor terms suffices. Since it's an alternating series you can maybe do the trick of taking only half of the next term to get another order of precision, but maybe it converges too fast for that.

Blu: good suggestion, thanks
As for Pow, the thing that scares me even more than efficiency is that JASS automatically typecasts between reals and integers.
PipeDream is offline   Reply With Quote