Fitting a Square to Four Points

Geometry Level 3

As the figure above shows, we are given the following 4 points in the XY plane, listed in counter-clockwise direction:

P 1 = ( 1.956292884 , 12.45603043 ) P_1 = (1.956292884, 12.45603043)

P 2 = ( 3.541888022 , 4.227012093 ) P_2 = (-3.541888022, 4.227012093)

P 3 = ( 10.44287164 , 1.437742959 ) P_3 = (10.44287164, 1.437742959)

P 4 = ( 7.341227934 , 12.90173469 ) P_4 = (7.341227934, 12.90173469)

We want to fit a square of general orientation to these four points. The only thing known about the points is that each point lies on a different side. They are ordered counter-clockwise to correspond with the sides.

Find the center ( x 0 , y 0 ) (x_0, y_0) and the side length a a of the fitting square, submit as your answer the concatenation of [ 100 x 0 ] \big[ 100 x_0 \big] and [ 100 y 0 ] \big[ 100 y_0 \big] and [ 100 a ] \big[ 100 a \big] . For example, if the center is ( 2.379 , 5.6178 ) (2.379, 5.6178) and the side length is 12.9315 12.9315 , then your answer should be 2385621293 2385621293 .

Inspiration


The answer is 4135461390.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Hosam Hajjir
Dec 26, 2017

Following the solution of Mark Hennings for the original problem posted by Steven Chase, we define the direction vectors of the sides of the square as

u = ( cos θ , sin θ ) u = (\cos \theta , \sin \theta) and v = ( sin θ , cos θ ) v = (-\sin \theta, \cos \theta)

It then follows by projecting the vector ( P 4 P 2 ) (P_4 - P_2) onto u u and ( P 1 P 3 ) (P1 - P3) onto v v , both projections being equal to the side length a a , namely,

( P 4 P 2 ) u = ( P 1 P 3 ) v = a (P_4 - P_2) \cdot u = (P_1 - P_3) \cdot v = a

which results in θ = 0.623 \theta = 0.623 (radians). Next, we can find the side length from the above equation also by plugging in the value of θ \theta found. The value thus found is a = 13.90 a = 13.90 .

What is left to find the center, and for that we can write two equations in the two unknown coordinates of the center r C r_C , namely,

( P 1 r C ) v = 1 2 a (P_1 - r_C) \cdot v = \dfrac{1}{2} a

and

( P 2 r C ) u = 1 2 a (P_2 - r_C) \cdot u = - \dfrac{1}{2} a

Solving this linear system gives r C = ( 4.13 , 5.46 ) r_C = (4.13, 5.46)

Therefore, the answer is 4135461390 4135461390

Below is the fitted square.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...