Converting x/y coords to 360 degrees rotation

Agustin  Echeverria 's icon

Hello I am trying to convert x/y coords to 360 degrees rotation in a pictslider

Like this but the oposite way

Max Patch
Copy patch and select New From Clipboard in Max.

Thank You

Agustin

double_UG's icon

"cartopol" object