Hi everybody, I've recently needed a fixed-point atan2() function for my day job. I looked around and didn't find anything ready-to-go for a 16-bit microcontroller. So I wrote a script to generate this function using a CORDIC algorithm. I put it online at http://vivara.net/cgi-bin/cordic.cgi The python source is available, but it requires a native C compiler to run the tests against the generated code. I tried to make the generated code something that any C compiler could apply optimizations on. I think it would be straightforward to "hand compile" it to assembler as well. Suggestions and bug reports welcome. Regards, Mark markrages@gmail -- Mark Rages, Engineer Midwest Telecine LLC markrages@midwesttelecine.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist