I’m struggling with a math problem and could use your help. I want to know the following:
- Is the inner box primarily on the left or right side?
- Is the inner box primarily positioned to the top or bottom of the outer box?
To figure this out I know the following:
- The height & width of the outer box, this is static at 200px
- The width of the inner box (var X)
- The inner box distance from the left of the outer box (var x2)
- the inner box distance from the top, (var y)
Any ideas oh how to determine if the inner box is primarily to the left or right.. top or bottom?
Thank you!

You can figure out the center of the inner box by averaging its left and right edges. Then compare that to the outer box center to figure out its primary direction.
In the code below, I’m calling
outerHandouterWinnerW(I’m assuming you know the height of the innerBox too and I’m calling that
innerH)leftPaddingtopPadding