How to determine how a point will be located on two frames of different sizes(Scale)?

What formula should I use for this?
https://gyazo.com/1049ca7dde9c5e0533cfb33377e9e639

I assume the video is the mouse’s screen positition being translated to a canvas. The way I would do this is by using mouse.X and mouse.Y, dividing them by the AbsoluteSize of the full screen, then using that scale to place an object on the canvas. E.g. for the X position it could be:

local mouseX = 349
local AbsoluteX = 400
local XScale = mouseX / AbsoluteX
-- do the same for the Y axis
GuiObject.Position = UDim2.new(XScale, 0, YScale, 0)