If anyone else is as stupid as me?? this might help if you are trying to figure out cos and tan!

BigNumber cose (const BigNumber x, BigNumber precision)

{

const BigNumber pi

("3.1415926535897932384626433832795028841971693993751058209749445923078164062862");

BigNumber pidiv2 (pi / BigNumber(2));

return (sine((x+pidiv2) , precision ));

} // end of function cose

BigNumber tane (const BigNumber x, BigNumber precision)

{

BigNumber tan (((sine((x),precision) / cose((x),precision))));

return tan;

}

That was how I implemented them anyway.

Also, I had a bit of a nightmare trying to implement LLtoNE in BigNumber format... If anyone else wants this, it is in the attachment.

Example output :-

Lat 53.121838, Lon -1.265120

Should give :- east 449174, north 358582

east 449174, north 358582

Lat 53.124981, Lon -1.298874

Should give :- east 446911, north 358909

east 446911, north 358909

Lat 53.144543, Lon -1.265869

Should give :- east 449098, north 361107

east 449098, north 361107

Over to you! Send Lat/Long pairs like this : 53.121838,-1.265120

Send required Bignumber precision like this : #20

BigNumber precision changed to 8 digits

Lat 53.121838, Lon -1.265120

east 449174, north 358581

Time taken 582456 microseconds

BigNumber precision changed to 15 digits

Lat 53.121838, Lon -1.265120

east 449174, north 358582

Time taken 1652496 microseconds

BigNumber precision changed to 25 digits

Lat 53.121838, Lon -1.265120

east 449174, north 358582

Time taken 4398332 microseconds

That would be the bulk of the work required to implement Lat/Long to OSGB conversion for anyone that might be interested, WITHOUT needing to buy an Arduino DUE!!

However, just in case you need to justify to the missus, why you NEED a DUE, try this :-

Lat 53.121838, Lon -1.265120

Should give :- east 449174, north 358582

east 449174, north 358582

Lat 53.124981, Lon -1.298874

Should give :- east 446911, north 358909

east 446911, north 358909

Lat 53.144543, Lon -1.265869

Should give :- east 449098, north 361107

east 449098, north 361107

Over to you! Send Lat/Long pairs like this : 53.121838,-1.265120

Send required Bignumber precision like this : #20

BigNumber precision changed to 8 digits

Lat 53.121838, Lon -1.265120

east 449174, north 358581

Time taken 41125 microseconds

BigNumber precision changed to 15 digits

Lat 53.121838, Lon -1.265120

east 449174, north 358582

Time taken 103574 microseconds

BigNumber precision changed to 25 digits

Lat 53.121838, Lon -1.265120

east 449174, north 358582

Time taken 270292 microseconds

Ok so through experimentation 9 digits of precision is the minimum to achieve correct results, here are the performance figures for this function :-

Digits precision | MEGA2560 | DUE |

9 | 0.689s | 0.048s |

10 | 0.825s | 0.055s |

15 | 1.652s | 0.104s |

25 | 4.398s | 0.270s |

I haven't understood how the "Arbitrary Precision" library works, is there any documentation about ?

Also, is there a real usage of this library ?

Yes!! This is one example!

I have also attached the natural 'DOUBLE' version of the same function. Depending on whether you have a DUE or not will reveal the weaknesses of single precision floats, particularly if you enter the same lat/long pairs used in the examples!

Cheers, G