On an arduino project I'm working on (ATMega328 at the moment) I have a bunch of vector distance data that I need to use for various pixels in a matrix.
It's a relatively simple calculation:
d = math.sqrt(math.pow(x2 - x1, 4) + math.pow(y2 - y1, 2)) //Not the arduino code
Very slightly modified coordinate distance formula (with exaggerated x values)
I know that a modern computer can do that easily, but is this going to be any slower or faster than having the values for a 22x12 matrix stored as a PROGMEM 2-D array of uchar? (x1 and y1 are fixed at the center point... so one grid only).
These values are basically fixed, I just need to know them. I know that accessing values in flash is much slower than in SRAM but not really sure how many clock cycles that's going to take compared to the above equation. An AVR isn't exactly optimized for such math.
Update: Also, it's not like I only need to look up some of the vector distance values on each pass. On every loop I need ALL of those values.