Math object

What would you like to see in CSPro?
Post Reply
htuser
Posts: 639
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Math object

Post 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
G.VOLNY, a CSProuser from Haiti, since 2004
Gregory Martin
Posts: 1851
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Math object

Post 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?
htuser
Posts: 639
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Math object

Post 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,
G.VOLNY, a CSProuser from Haiti, since 2004
Post Reply