# Distance between points

1. Apr 26, 2010

### lampshader

1. The problem statement, all variables and given/known data

A triangle is defined by the following vertices: (40,85), (15,0), and (-40,35). Is it a right triangle?

2. Relevant equations

Distance Formula:

Given two points A(1,2) and B(3,4) Find the distance using the below forumla.

d(A,B) = sqrt((x2-x1)^2 + (y2-y1)^2)

3. The attempt at a solution

1) We have X(40,85), Y(15,0), and Z(-40,35)

2) We can use the distance formula b/c it is derived from pythagorean therom (which determines if a triangle is a right triangle).

3) Using the distance formula for three vertices given two components for each might look something like this:

d(x,y,z) = sqrt((x3-x2-x1)^2 + (y3-y2-y1)^2)

~107?

2. Apr 26, 2010

### willem2

Distances are between 2 points. You want to find the 3 distances between the 3
possible pairs of points, and then check wether the square of one of them is equal
to the sum of squares of the other 2.

Another option is to draw vectors between the points and check wether the inner
product of a pair of them is equal to 0.

3. Apr 26, 2010

### lampshader

Okay, basically using my three points as a, b, and c, where, a(40,85), b(15,0), and c(-40,35).

using c^2 = a^2 + b^2
$$\Delta$$c^2 = $$\Delta$$a^2 + $$\Delta$$b^2 ??

4. Apr 26, 2010

### lampshader

1. The problem statement, all variables and given/known data

A triangle is defined by the following vertices: (40,85), (15,0), and (-40,35). Is it a right triangle?

Just wondering if what i have here is correct:

d(x,y) = sqrt((x2-x1)^2+(y2-y1)^2)
= sqrt((85-40)^2+(0-15)^2)
= sqrt((45)^2+(-15)^2)
= sqrt(2025+225)
= 47.43

d(x,z) = sqrt((x2-x1)^2+(z2-z1)^2)
= sqrt(2025+(35-(-40))^2)
= sqrt(2025+(75)^2)
= sqrt(2025+5625)
= 87.5

d(y,z) = sqrt((y2-y1)^2+(z2-z1)^2)
= sqrt((0-15)^2+5625)
= sqrt((-15)^2 +5625)
= sqrt(225+5625)
= 76.5

We found the longest side and we have now a,b,c values to use for pythagoream theroem:

d(x,z)^2 = d(y,z)^2 + d(x,y)^2

87.5^2 = 76.5^2 + 47.43^2

7656.25 = 5852.25 + 2249.6

7656.25 != 8101.85

So it is not a rightangle.

5. Apr 27, 2010

### willem2

your notation d(x,y) makes no sense.

The distance between (x1,y1) and (x2,y2) is sqrt ((x2 - x1)^2 + (y2-y1)^2)

you need to subtract the x and the y coordinates of two different points, not the
x and y coordinates of the same point.

6. Apr 27, 2010

### lampshader

Alright, in continuation to the original problem:

A shape is defined by the following vertices: (40,85), (15,0), and (-40,35) Is it a right triangle?

I think that each point is a vector for a side of the potential right triangle.

We can use the following vector formula:

V1 = ((x1-x2)-(y1-y2))
V2 = ((x1-x3)-(y1-y3))
V3 = ((x2-x3)-(y2-y3))

V1 = (40-15,85-0) = (25.85) Substitute our values and find the coordinate for a side
V2 = (40-(-40), 85-35) = (80,50)
V3 = (15-(-40), 0-35) = (55,-35)

We now use the following matrix formula:

A
(C D) = AC + BD;
B

V1^t * V2 = 25 (80,50) = 25*80 + 85 * 50
85 = 6250

V1^t * V3 = 25 (55,-35) = 25*55 + 85 * -35
85 = -1600

V2^t * V3 = 80 (55,-35) = 80*55 + 50 * -35
50 = 2650

V1^t * V2 = 6250
V1^t * V3 = -1600
V2^t * V3 = 2650
Based on the multiplications for each vector and matrix this is not a right angle, but an orthogonal.

7. Apr 28, 2010

### willem2

This is correct. Only the angles are not right angles because the inner product (or dot products) are not equal to 0. If two vectors are orthogonal, it means they are perpendicular BTW.

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook