Dear CSPro Development Team,
Following my idea to port existing calculation to CSPro designed application, i would like to know if i can port this: https://www.igismap.com/formula-to-find ... longitude/
or https://gis.stackexchange.com/questions ... -arduino-c
to CSPro logic. It's very important to have this since, i always use radio button lookup list in any census or survey. In this list, enumerators always have: Name, Surname, adresse, phone number, distance of all houselhold (head) that are affected to them. Right now, and want to add bearing.
Before me, other already need it:
http://csprousers.org/forum/viewtopic.php?f=6&t=980
I would be very easy to calculate if we could import and use http://www.cplusplus.com/reference/cmath/
in CSPro logic.
Thanks in advance for your support!
Bearing Calculation
Bearing Calculation
G.VOLNY, a CSProuser from Haiti, since 2004
Re: Bearing Calculation
Back in the old days before calculators and computers people used tables to calculate trigonometric functions: https://www.analyzemath.com/trigonometr ... table.html
You could use the same technique in your CSPro program with arrays or lookup files to create your own sin, cos and atan functions. You could either copy the tables from the above website or generate your own in Excel. To use the table to compute the value of the function you find the closest angle in the table and then get the corresponding function value in that row i.e. for sin(x) you find the value closest to x in the first column (if using degrees or second column if using radians) and then get the value in the same row for sin. If you want to be more precise you could use linear interpolation between the two closest values although for what you are doing I don't think you would need that.
You could use the same technique in your CSPro program with arrays or lookup files to create your own sin, cos and atan functions. You could either copy the tables from the above website or generate your own in Excel. To use the table to compute the value of the function you find the closest angle in the table and then get the corresponding function value in that row i.e. for sin(x) you find the value closest to x in the first column (if using degrees or second column if using radians) and then get the value in the same row for sin. If you want to be more precise you could use linear interpolation between the two closest values although for what you are doing I don't think you would need that.
Re: Bearing Calculation
Thanks a lot Josh.
This should work.
I'll use excel to calculate them, since theses functions already exists in it.
However, in the future, for more complicated calculation and for more accuracy, it would be better to have the ability to use complete math library in CSPro Logic.
Best Regards,
This should work.
I'll use excel to calculate them, since theses functions already exists in it.
However, in the future, for more complicated calculation and for more accuracy, it would be better to have the ability to use complete math library in CSPro Logic.
Best Regards,
G.VOLNY, a CSProuser from Haiti, since 2004