Look at the xy() function in the OctoWS2811 examples.

This is the one from the File example (in Arduino, click File > Examples > OctoWS2811 > Fire)



// A simple xy() function to turn display...