NetLinx math library
PhreaK
Senior Member
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.
Comments
-
Nice to see you take an initiative, I'll definitely check it out. And see if I can help out in any way
-
Yay for log functions. That was going to be one of the next things I was going to work on.
-
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.
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 -
The log and power algorithms are public domain domain. The fast inverse square root algorithm is an old one which, as noted, was originally created by Greg Walsh and later popularized in Quake II. Then everything that is remaining is mine.
So as far as I know licensing wise it's all solid. What had you concerned? -
The log and power algorithms are public domain domain. The fast inverse square root algorithm is an old one which, as noted, was originally created by Greg Walsh and later popularized in Quake II. Then everything that is remaining is mine.
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 -
id never had the copyright for that inverse square root algorithm. Carmack is one seriously smart uber geek but it's not his original work. There's a full history of it here and a follow up here.
Chris Lomont also has a nice paper on how it works.
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums