Hi, how would one code an 8 channel panner, considering a circle speaker setup?

I'm not looking for an external, I wanna know how to do it as a patch, then as an external into my externals library - as a request :) 


But if there's an external around, maybe I could check it out how it's done ;)


thanks