After the origin() command is just a translation
x = xo + (CanvasWidth/2)
y = yo + (CanvasHeight/2)
do the transformation x = xx and y = (CanvasHeight - 1) - yy
xx = xo + (CanvasWidth/2)
(CanvasHeight - 1) - yy = yo + (CanvasHeight/2)
Next do some rearrangement
xo = xx - (CanvasWidth/2)
yo = (CanvasHeight - 1) - yy - (CanvasHeight/2)
So now you can convert from your coordinate to xo,yo
And if you want to use xxo,yyo instead of your xx,yy then
xx = xxo + (CanvasWidth/2)
yy = yyo + (CanvasHeight/2)
Next do the substitution
xo = (xx) - (CanvasWidth/2)
yo = (CanvasHeight - 1) - (yy) - (CanvasHeight/2)
to
xo = (xxo + (CanvasWidth/2)) - (CanvasWidth/2)
yo = (CanvasHeight - 1) - (yyo + (CanvasHeight/2)) - (CanvasHeight/2)
and do some cleanup
xo = xxo
yo = -1 - yyo