cordic_calc_iq(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– cordic_calc_iq β€” the kernel API manual, bestie edition πŸ’–

okay so you're in the cordic part of the kernel API docs (man section 9, kernel devs only, iykyk ✨) and you found cordic_calc_iq. slay. let's get into it πŸŽ€


🌸 NAME 🌸

cordic_calc_iq β€” calculates the i/q coordinate for given angle. that's it, that's the whole vibe πŸ’…


✨ SYNOPSIS ✨

struct cordic_iq cordic_calc_iq (s32 theta );

literally one argument, one struct back. no cap, it's giving minimal and iconic πŸ¦‹


🧚 ARGUMENTS 🧚

  • theta β€” the angle, in degrees, that you want the i/q coordinate calculated for. that's the number you hand over, and it wants degrees, not radians, don't come at it with radians πŸ™ˆ

πŸ”₯ DESCRIPTION πŸ”₯

so this function calculates the i/q coordinate for a given angle using the CORDIC algorithm. yes, the classic one, we love a legend πŸ‘‘

the coordinate it gives you is made of two parts, bestie:

  • the real (i) part
  • the imaginary (q) part

and the way it works out is genuinely kind of beautiful: the real part is essentially the cosine of the angle, and the imaginary part is the sine of the angle. cos and sin, doing their main character thing 🌈

one thing to remember though β€” the returned values are scaled by 2^16 for precision. so don't just read them raw and expect a clean Β±1, okay? scale it back, king πŸ’œ

as for theta, the range is -180 degrees to +180 degrees. anything you pass outside that range? it gets converted before doing the actual calculation β€” so it's handled, it's fine, nobody's gonna yell at you 🫢


πŸ‘€ SEE ALSO πŸ‘€

  • Kernel file ./include/linux/cordic.h
  • struct cordic_iq(9)

and that's the whole page, bestie, you ate it up fr fr πŸ”₯

that's the docs straight out of the kernel source tree at ./include/linux, all dated October 2026 β€” the version/source line of this very page, now living rent free in your brain πŸ“πŸ§šπŸ’–

periodt. go calculate some coordinates πŸ’…

πŸ“¦ where this page comes from