
Jayden H. answered 02/07/19
I am patient and love helping people learn.
I am assuming there is an image illustrating this because from the question it is not clear which vertex is shared by the two rectangles. Both rectangles have two left hand corners (vertices). Thankfully it doesn't matter which vertices are shared.
You first find the coordinates of the center of each rectangle then find the distance between these two point. Let us dump the two rectangles on a graph as described in the question. We can simplify the math by assuming the bottom left vertices are the ones shared by both rectangles so all numbers are positive. Let us make it even easier by placing the center of the smaller rectangle at the origin.
The distance formula between to points:
d = √((x2 - x1)2 + (y2 - y1)2)
Since we placed the center of the small rectangle at the origin:
x1 = 0
y1 = 0
The center of the larger rectangle is:
x2 = (width of large rectangle(9) / 2) - (width of small rectangle(6) / 2)
y2 = (height of large rectangle(12) / 2) - (height of small rectangle(8) / 2)
Since x1 and y1 are both 0 the distance formula can be simplified to:
d = √((x2)2 + (y2)2)