The reason CB is so good at calculations, is that it uses a very simple but ingenious math approach.
All calculations are done to maximum precision, and the results are then rounded to the specified precision.
That's pretty neat
Over the years, it's been tested on heavy applications such as seismology, which required 5 dimensional arrays. Hence IonicWind programming systems from CB onwards were developed to be capable of handling arrays of up to 5 dimensions. Clever stuff ..
Last post by Egil - November 01, 2019, 04:11:33 am
Bill, This morning we made some simulations on the chart machine (Kongsberg) onboard a local trawler. We simulated making a sailing plan for sailing the vessel between here and Tromsoe, along the coast. Then I put the resulting waypoint positions into my own code to see the difference. The legs varied in length from 16 to 128 nautical miles. The bearings were all exactly the same on both systems, regardless of number of decimals. But the distances varied slightly between the two systems. Then I increased precision with one decimal at the time. From 6 decimals and up, both systems showed exactly the same results.
This was a positive surprise, as I never thought that the CB code was so accurate. Therefore I assume that for more accuracy on longer distances, you have to use more decimals.
In case you want to experiment, I attach the latest Arinc system table. It is transmitted from the mentioned transmitter sites once a year, plus in case any frequency is changed. This one came when they set up a new transmitter site in Muan, South Korea, ten months ago. That is where I found the positions, before I converted them into degrees with decimals. In cas you see how to improve the calculation routines, please let me know.
I've noticed the same thing. And I reckon that where a geo point is set, is more or less up to the people producing maps. The positions I have used in the example, are all the registered positionsm of the Arinc transmitter sites, used for data communications with international flights. And these transmitters are most often located at remote places, far from city centers. But they always use the same name as the nearest city.
When coding the posted example, I set precision to zero, so the rounding errors will in some cases be rather large. But if the positions passed to the distance routine has a greater precision the result will be more accurate. I have only tested the code with CB, and using ten decimals slowed down the process very much. But for the application I plan to make, I'll only use the code for indicating the course of the decoded flight data, and show it on a map. For this the calculations will be of sufficient accuracy.
But if tanslated to IWB code, the speed should increase noticeably. In fact, that is what I plan to do when I have made all the routines I need, and see that everything works ok.
Last post by billhsln - October 31, 2019, 02:37:46 pm
Very interesting. Have you ever noticed that most sites where you can get Lat and Long seem to differ as to where a city is located. Looked up Auckland, NZ and your value is different than what I could find from a couple of different sites. Was wondering how much difference a few points off would make in the distance.
At my work we have a file with info for all the US cities and even it differs from other sites. I wonder how they determine what they think is the correct value.
When I needed formulas for calculating Great circle Bearings and Distances, I first searched the Internet. Just to find that there is a lot of confusion out there about the difference between Great Circle bearings and Rhumb Line bearings. Finally found correct formulas in a book on my own bookshelf! The largest challenge was to get the bearings into the correct quadrants. And finally, the Atan2 function was posted by GWS (Thanks Graham!). It is slightly rearranged before using it here.
PS almost forgot to say that the code includes calculations for b3earing and distance f4rom my home to places around the world.