Help positioning UI object to a UI object position in different parents

I am having trouble figuring out how I can position a frame to a frame position in a different parent.

local targetFrame
local frameToMove

local parent = frameToMove.Parent

local absolutePos = targetFrame.AbsolutePosition
local absoluteSize = targetFrame.AbsoluteSize

local targetParentPos = parent.AbsolutePosition
local targetParentSize = parent.AbsoluteSize

local x = absolutePos.X / targetParentSize.X
local y = absolutePos.Y / targetParentSize.Y

local offsetX = absoluteSize.X / (2 * targetParentSize.X)
local offsetY = absoluteSize.Y / (2 * targetParentSize.Y)

frameToMove.Position = UDim2.fromScale(x + offsetX, y  + offsetY)

You can use the offset between the target element and the parent element,

local parentFrame: Frame
local childFrame: Frame --Child of `parentFrame`
local targetFrame: Frame

local offset = targetFrame.AbsolutePosition - parentFrame.AbsolutePosition
childFrame.Position = UDim2.fromOffset(offset.X, offset.Y)

Note: This does not take into account AnchorPoints

I am trying to do this in scale, not offset, but this would be helpful.