if I were to write a cog that would contain functions for square root, logarithm (any base), trig and inverse trig, etc... would anyone use these?
I'll probably write them anyway as a learning experience (taylor polynomials btw), but I was just wondering if this would be useful to anyone. You could call them via SendMessageEx() and a value would be returned via ReturnEx().
Here's some examples to give you an idea of how this might work...
squareroot = SendMessageEx(mathcog, user7, n, 0, 0, 0)
...where n is the parameter of the function
result = SendMessageEx(mathcog, user7, n, f, 0, 1)
...where n = the parameter of the function and f determines which (inverse) trig function to use (ie if f = 1, cosine; if f = 3, inverse sine; etc)
logarithm = SendMessageEx(mathcog, user7, n, base, 0, 2);
...where n is the parameter of the function and base is which number will be the base (ie. 10, e,...). I suppose entering 0 will default the base to e
btw, I'm aware there's already a square root one floating around somewhere, but as I said, this will be a learning experience for me (besides, I already started on this one). Also, I'm not sure how useful the log functions may become, but ironically it'll be one of the easier of the functions to write![;)](../../smileys/wink.gif)
Lastly, if you have any ideas and such, please share them here. Thanks.
I'll probably write them anyway as a learning experience (taylor polynomials btw), but I was just wondering if this would be useful to anyone. You could call them via SendMessageEx() and a value would be returned via ReturnEx().
Here's some examples to give you an idea of how this might work...
squareroot = SendMessageEx(mathcog, user7, n, 0, 0, 0)
...where n is the parameter of the function
result = SendMessageEx(mathcog, user7, n, f, 0, 1)
...where n = the parameter of the function and f determines which (inverse) trig function to use (ie if f = 1, cosine; if f = 3, inverse sine; etc)
logarithm = SendMessageEx(mathcog, user7, n, base, 0, 2);
...where n is the parameter of the function and base is which number will be the base (ie. 10, e,...). I suppose entering 0 will default the base to e
btw, I'm aware there's already a square root one floating around somewhere, but as I said, this will be a learning experience for me (besides, I already started on this one). Also, I'm not sure how useful the log functions may become, but ironically it'll be one of the easier of the functions to write
![;)](../../smileys/wink.gif)
Lastly, if you have any ideas and such, please share them here. Thanks.
May the mass times acceleration be with you.