Calculate third point of isosceles triangle given two points and distance

289 Views Asked by At

Calculate third point of isosceles triangle given two points and distance
Given values -
givenvalues

Problem image - Isosceles Triangle

My solution to the problem,my solution

After substituting values, Isosceles Triangle after substituting values

But, I had no idea on how to find the point A(xa, xb)?
please help me to find the solution

2

There are 2 best solutions below

0
On BEST ANSWER

In fact, there a way to obtain the coordinates of point $A$ without solving a quadratic equation. See program below (sorry, in Matlab, but so cousin to Python...).

  1. Compute vector $\vec{DB}=\frac12 \vec{CB}=\pmatrix{r_1\\s_1}=\pmatrix{\tfrac12(x_B-x_C)\\ \tfrac12(y_B-y_C)}$ and its norm.

  2. Deduce from this norm the length $\ell$ of altitude $AD$ by using Pythagoras in right triangle $ADB$.

  3. Then, due to vector equation :

$$\vec{DA}=\ell \vec{V} \ \ \iff \ \ A=D+\ell \vec{V}$$

the coordinates of $A$ are :

$$\begin{cases}x_A&=&x_D+ \ell r\\ y_A&=&y_D+ \ell s\end{cases}$$

where midpoint $D$ has coordinates $$D=\pmatrix{\tfrac12(x_B+x_C)\\ \tfrac12(y_B+y_C)} $$

and $V=\pmatrix{r\\s}$ is defined in two steps :

  • first, we set $$ \vec{W} = \pmatrix{-s_1\\r_1}$$

(please note that $\vec{W}$ is an orthogonal vector to vector $\vec{DB}$)

  • then the normalized vector $\vec{V}$ is obtained by dividing $\vec{W}$ by its norm (its length).

Matlab program:

xB=9.48;yB=12.175;xC=9.877;yC=8.591;
xD=(xB+xC)/2;yD=(yB+yC)/2;   % midpoint D
r1=(xC-xB)/2;s1=(yC-yB)/2;   % vector DB
DB=sqrt(r1^2+s1^2);          % length DB
el=sqrt(5^2-DB^2);           % length of altitude AD
Wx=-s1;Wy=r1;                % vector orth. to vector DB
Vx=Wx/DB;Vy=Wy/DB;           % unit vector (length W = length DB)
xA=xD+el*Vx;                 % 14.314
yA=yD+el*Vy;                 % 10.896
1
On

Here is the solution to the problem:
Mathematical Expression Problem Solving

Python code to check output:

    def distance(p1, p2):
        x1 = p1[0]
        y1 = p1[1]
        x2 = p2[0]
        y2 = p2[1]
        return math.sqrt(math.pow(x1-x2,2) + math.pow(y1-y2,2))

    def findCenter(p1, p2, radius):
        x1 = p1[0]
        y1 = p1[1]
        x2 = p2[0]
        y2 = p2[1]

        c1 = math.pow(x1,2) - math.pow(x2,2) + math.pow(y1,2) - math.pow(y2,2)
        c2 = 2*(x1-x2)
        c3 = 2*(y1-y2)

        d1 = c1/c3 
        d2 = c2/c3

        a = 1 + math.pow(d2, 2)
        b = -2*x1 - 2*(d1)*(d2) + 2*(d2)*y1
        c = math.pow(x1,2) + math.pow(y1,2) + math.pow(d1, 2) - 2*d1*y1 - math.pow(radius,2)

        x3_1 = (-b + math.sqrt(math.pow(b,2) - 4*a*c))/(2*a)
        x3_2 = (-b - math.sqrt(math.pow(b,2) - 4*a*c))/(2*a)

        y3_1 = (c1 - c2*x3_1)/c3
        y3_2 = (c1 - c2*x3_2)/c3

        p3_1 = [x3_1, y3_1]
        p3_2 = [x3_2, y3_2]
        return p3_1, p3_2

    # For your question
    p1 = [9.48, 12.175]
    p2 = [9.877, 8.591]
    radius = 5
    p3_1, p3_2 = findCenter(p1, p2, radius)

    print("Answer for your question")
    print(p3_1)
    print(p3_2)
    print("distance p1, p3_1 = ", distance(p1, p3_1))
    print("distance p2, p3_1 = ", distance(p2, p3_1))
    print("distance p1, p3_2 = ", distance(p1, p3_2))
    print("distance p2, p3_2 = ", distance(p2, p3_2))

    # For Byjus question how-do-you-find-the-center-of-a-circle-given-two-points
    p1 = [5,4]
    p2 = [3,6]
    radius = 10
    p3_1, p3_2 = findCenter(p1, p2, radius)

    print("\n\nFor Byjus question")
    print(p3_1)
    print(p3_2)
    print("distance p1, p3_1 = ", distance(p1, p3_1))
    print("distance p2, p3_1 = ", distance(p2, p3_1))
    print("distance p1, p3_2 = ", distance(p1, p3_2))
    print("distance p2, p3_2 = ", distance(p2, p3_2))

Ouput:-

Answer for your question
[14.313767402298724, 10.896448984015787]
[5.043232597701277, 9.869551015984205]
distance p1, p3_1 = 5.000000000000002
distance p2, p3_1 = 5.0
distance p1, p3_2 = 5.000000000000003
distance p2, p3_2 = 5.0
.
For Byjus question
[11.0, 12.0]
[-3.0, -2.0]
distance p1, p3_1 = 10.0
distance p2, p3_1 = 10.0
distance p1, p3_2 = 10.0
distance p2, p3_2 = 10.0
Press any key to continue . . .