NetLinx math library
PhreaK
Posts: 966
So with all this recent discussion about open source projects and how sexy they can be etc I thought I'd finally get round to putting up an initial version of the native netlinx math library I've been working on.
Presently the library is pretty basic, partially due to a lack of time, but also due to a lack on knowledge on my part (I'm working on it though). The initial release gives you:
- ceiling
- floor
- round
- inverse square root
- a fast square root (I'm working on an accuracte / real sqrt, but haven't had any success so far)
- logarithm (to an arbitary base)
- natural log
- log base 2
- log base 10
- power
- a boolean 'isWholeNumber' test
- the ability to decompile and recompile floating point values (if for whatever reason you feel the need)
The next milestone I will be trying to work towards is a set of trig functions.
I've set it up as a google code project to keep things nice and easy. At the moment it is licensed under the Mozilla Public License so feel free to grab a copy and start using it in any projects you desire. If you do make any modifications, improvements or optimisations please respect the license and share alike (only the math.axi, not your whole project). If anyone is keen to become a contributor let me know and I'll give you full access, I'm putting this out there to try an kick start a community effort. Also, if you just grab a copy and just find it useful let me know to .
Anyway, here it is https://code.google.com/p/amx-netlinx-math/.
*Edit*
This has now merged into the NetLinx Common Libraries project.
Looking forward to seeing how this turns out.
P.S. I've also got a string manipulation library in the works so stay tuned.
Update:
String library here.
Presently the library is pretty basic, partially due to a lack of time, but also due to a lack on knowledge on my part (I'm working on it though). The initial release gives you:
- ceiling
- floor
- round
- inverse square root
- a fast square root (I'm working on an accuracte / real sqrt, but haven't had any success so far)
- logarithm (to an arbitary base)
- natural log
- log base 2
- log base 10
- power
- a boolean 'isWholeNumber' test
- the ability to decompile and recompile floating point values (if for whatever reason you feel the need)
The next milestone I will be trying to work towards is a set of trig functions.
I've set it up as a google code project to keep things nice and easy. At the moment it is licensed under the Mozilla Public License so feel free to grab a copy and start using it in any projects you desire. If you do make any modifications, improvements or optimisations please respect the license and share alike (only the math.axi, not your whole project). If anyone is keen to become a contributor let me know and I'll give you full access, I'm putting this out there to try an kick start a community effort. Also, if you just grab a copy and just find it useful let me know to .
Anyway, here it is https://code.google.com/p/amx-netlinx-math/.
*Edit*
This has now merged into the NetLinx Common Libraries project.
Looking forward to seeing how this turns out.
P.S. I've also got a string manipulation library in the works so stay tuned.
Update:
String library here.
0
Comments
Looking at the Math file, it seems like a lot of this code is derivative of other code I have seen before. Are you sure you have the exclusive rights to it?
Paul
So as far as I know licensing wise it's all solid. What had you concerned?
I'd seen the math_inv_sqrt in other code, and thought I had seen the math_log function elsewhere too so I thought I would ask. I never looked into whether that code was in the public domain or still under copyright by id Software. How did you find out that it was public domain? If it is, that would be cool as I would like to use it for an upcoming project.
Paul
Chris Lomont also has a nice paper on how it works.