Difference between revisions of "Talk:Simulating new functions"
Jump to navigation
Jump to search
no edit summary
imported>JustTim |
imported>Maian |
||
Line 533: | Line 533: | ||
Thanks for sharing this! I've already written a new getAngle Function using the Arctan function by DragoonWraith, flipping it around in 90 degree steps to avoid the inaccuracy in angles bigger than 45 degrees. You can find it in the article. It could (once again) be total mathematical nonsense, but in my tests it looks very accurate. | Thanks for sharing this! I've already written a new getAngle Function using the Arctan function by DragoonWraith, flipping it around in 90 degree steps to avoid the inaccuracy in angles bigger than 45 degrees. You can find it in the article. It could (once again) be total mathematical nonsense, but in my tests it looks very accurate. | ||
You said you are using activators to simulate functions, are you sure the activation executes immediately? i had problems with this in my tests. --[[User:JustTim|JustTim]] 18:29, 8 May 2006 (EDT) | You said you are using activators to simulate functions, are you sure the activation executes immediately? i had problems with this in my tests. --[[User:JustTim|JustTim]] 18:29, 8 May 2006 (EDT) | ||
Although I haven't tested it a lot, the OnActivate blocks should immediately execute. After all, Tegid and MrFlippy use OnActivate extensively in their pseudo-array scripts. | |||
The math looks fine to me. You can increase the accuracy of the arctan function by adding t* terms. See http://en.wikipedia.org/wiki/Taylor_series#List_of_Taylor_series_of_some_common_functions for more info. The accuracy of the square root function you once had could be increased by adding more the same lines, though I think it's accurate enough. Of course, there's a balance between speed and accuracy, and I think it would be okay if the arctan func is accurate to 1 degree. BTW you should add that square root function back - even if it isn't used for getAngle, it's still be a very useful function. --[[User:Maian|Maian]] 19:40, 8 May 2006 (EDT) |