Page 1 of 1

Math object

Posted: May 29th, 2019, 9:58 am
by htuser
Dear Cspro Developer Team,
Following my last discussion
http://csprousers.org/forum/viewtopic.php?f=1&t=3385
I would like to know if it's possible (for future versions) to have a math object similar to : https://www.w3schools.com/js/js_math.asp
or Android's Math Class: https://developer.android.com/reference/java/lang/Math

Since C/C++ librairies are supported both, on Windows and Android, having ability to use/import math.h/cmath : http://www.cplusplus.com/reference/cmath/
would do the job following the way, "built once, deploy manies".

Please let's know!
Thanks in advance

Re: Math object

Posted: May 29th, 2019, 11:45 am
by Gregory Martin
It's not as simple as including an existing C/Java math library because we have to wrap those functions to make them exposed in the CSPro logic language. For example, the CSPro function int calls into the C math function floor.

What math functions in particular are you interested in?

Re: Math object

Posted: May 29th, 2019, 12:23 pm
by htuser
Thank you Greg for response.

CSPro already have some math functions. However, with the future mapping module, i think that, trigonometric and hyperbolic functions are welcome. Necessary for porting some existing algorithms to CSPro Logic and ask less CSPro function to you.

In my one of latest posts, theses functions was very important for queries such as: Point to point dynamic bearing and distance calculation, this for better enumerators navigation on the field. Josh give us a way to interpolate using trigonometric table, (methods using before having calculators...), but the best and more accurate is to have the way to use existing functions.

Another example is point to line, polygon distance: shortest way : https://stackoverflow.com/questions/849 ... ne-segment

True north calculation: https://www.codeproject.com/Articles/11 ... plications
And so on, require theses functions.

I think about include since the CSPro Engine is written in C++. And all existing know language accept C/C++ libraries natively. RCpp for R etc.

Finally, this math object can regroup all already existing in CSPro Logic, related math functions.

Thanks in advance,