Close

CORDIC ARCSINE ARCCOSINE

A project log for LIBCORDIC

OK this needs to be a separate thing here and well it may be on going for a bit. COORDINATE ROTATIONAL DIGITAL COMPUTER blame the 50's!

earl-tEARL T 09/20/2025 at 03:530 Comments

My original intention was to write this second log on log exp but as I was working on asin acos I found that the paper I was working off CORDIC-Based_Computation_of_Arcsine_and_Arccosine_Functions_on_FPGA which recommends a scaling factor to be applied to the target (t) after many adjustments and attempts at getting asin within .0_ accuracy I found removing the scaling factor to result in  more accuracy using the same setup as the sin cos  and i'm going to continue testing a bit latter as .I had been stumped for 2 days on such a simple problem . 

I would also like to explain real quick what asin and acos are they are the anti sin cos when supplied with a sin value asin will return the angle so what you asin(sin(x))=x and acos(cos(x))=x they are the inverse operations of each other hence why

dwould be another way to write asin same applies to acos so for angle to ratio sin for ratio to angle asin .If anyone reading this wants a more complete explanation of  the trig functions just tell me I'll be happy to provide an accurate explanation to the best of my ability if  y'all know this already ignore my ignorance I only made it threw 2 years of high school and not a very good one so I'm sometimes not aware of what is common knowledge. I'm going to push to my github sometime in the next probably day once I have modified my Makefile and added the asin acos functions to my CORDIC_CAL shell so I can test them more. I'm also thinking I may need to add a 64 bit version with a greater Q say 40 and more iterations to see how accurate results can get but that is towards the future .I still have square and square root before i can attempt haversine in CORDIC. at which point I believe I can make the cor of this in to a lib or 2 libs as and write a short program that should once i remove the one round I have in fix point run without any dependencies beyond std lib . to go much further beyond haversine in that direction I will have to add atan and atan2 which will bring me closer to a full set of cordic trig functions .I do relize that some of these are not just trig functions but  and hopefully once I include some simd neon instructions so that say . The  sin(dlon/2)^2  and sin(dlan/2)^2 likewise with the cos lat1 and lat2 witch due to the nature of cordic will also produce the sin of lat1 and lat2 for finding the true heading while this may be not nessary for many real world applications.

Discussions