How do I keep GUI Object position when changing anchor point?

so to explain

if I set a position of a object to
UDim2.new(.5,0,.5,0)
with a AnchorPoint of Vector2.new(.5,.5)

if I changed the AnchorPoint the AbsolutePosition changes
what I want to do is change the AnchorPoint but keep the exact position the frame was in without changing

how would I go with doing this?