Proving Right Angle Using Cartesian Coordinates

In summary, UrbanXrisis suggests a method for checking whether two intersecting lines create a right angle or not using the slope of the lines. If the slope of a line is 0, what does that tell you about the line? If the slope of the line is undefined, how are those two lines related? If you only need to find out whether the lines are perpendicular, you don't even need to worry about the denominator. Bob's vector method may look overly complicated for this one, but it is the most attractive one and atleast needs to be practiced if one is into programming. Higher level graphics development depends largely on vector methods and their matrix representations.
  • #1
UrbanXrisis
1,196
1
okay, I looked around in google and I'm not getting what I need. What is the formula to prove if two intersecting lines create a right angle or not? Having Cartesian coordinates only.
 
Physics news on Phys.org
  • #2
There are a couple of ways to do it. The first that occurs to me is to look at the slopes. What do you know about the slopes of perpendicular lines?
 
  • #3
negative reciprocal, however, if the slope of a coordinate was 0, then the reciprocal of that would be undefined
 
  • #4
Sorry to be picky, but a "coordinate" has no slope.

If the slope of a line is 0, what does that tell you about the line? What if the slope of the line is undefined? And how are those two lines related?
 
  • #5
you see, I'm writing a Java program, and I would give me a divide by zero error if I tried to find the slope that was vertical. But I have an idea, I would just say that if the 2 x's are equal, then skip to find the slope of the second line. If the slope of that line is zero, then it creates a right angle.

thanks for the help
 
  • #6
You're welcome, and your idea will work just fine. I've used that many times. :)
 
  • #7
You could test the dot product. If zero, the lines are perpendicular.

The dot product is just a variation on the cosine difference identity.

[tex]\frac{x_1 * x_2 + y_1 * y_2+ z_1 * z_2}{v_1*v_2} = cos \theta[/tex]

with [tex]\theta[/tex] being the angle between the two lines.
The denominator of the left hand side is the product of the norms of the two vectors. If you only need to find out whether the lines are perpendicular, you don't even need to worry about the denominator.
The x_1, y_1, z_1, etc. are Cartesian coordinates for the vector (v_1, etc)
The cosine of a 90 degree angle is zero.


If you're only working in two dimensions, just leave the z's out (z_1 and z_2 are both equal to zero when working in two dimensions)
 
  • #8
say your 2 lines are represented by 2 equations.

[tex] y=m_1 x + b_1 [/tex]

[tex] y=m_2 x + b_2 [/tex]

the slope [tex]m_1= \frac{y_1}{x_1}[/tex]
and the same goes for [itex]m_2[/itex]

if [tex] x_1x_2+y_1y_2=0[/tex] then the lines are perpendicular.

the only case where there's a problem is when one of your lines is zero. However in that case if the slope of the other line is anything but undefined then it's obvious it isn't perpendicular.

If your question was finding a perpendicular line given the first then the negative reciprocal of the slope should suit you fine.
 
  • #9
Bob's vector method may look overly complicated for this one but it is the most attractive one and atleast needs to be practiced if one is into programming. Higher level graphics development depends largely on vector methods and their matrix representations.

-- AI
 
  • #10
UrbanXrisis said:
you see, I'm writing a Java program, and I would give me a divide by zero error if I tried to find the slope that was vertical. But I have an idea, I would just say that if the 2 x's are equal, then skip to find the slope of the second line. If the slope of that line is zero, then it creates a right angle.

thanks for the help

Hi UrbanXrisis

If you are writing a method in Java to do this calculation, I think you should use the fact that the ratio of the gradients of two intersecting lines is negative if the lines are perpendicular to each other.

If you have your Cartesian coordinates, you can obtain both gradients, but your method will need to have some special circumstances, like: -

1. if one of the lines have a gradient of infinity (vertical line), then the lines will be perpendicular if the other line has nought gradient.

...however, you will have other special circumstances if you write your Java method this way. I've thought of one way which might be helpful to you.

If you know that the ratio of the gradients of 2 perpendicular lines is negative, you will quickly notice that the absolute values of the two gradients should be equal !

If line L1 (gradient = m1) is perpendicular to line L2 (gradient = m2), then m1/m2 = -1 and |m1| = |m2|. So, you can test the equality of the absolute values of the gradients first. If they match, you can test whether one of them is negative, and if one of them is negative, the lines are perpendicular.

There is a built-in function in Java which you can use to determine the absolute values of a real number: -
Code:
Math.abs(x)
 
  • #11
Damn I didn't think about that.

If you multiply m1 by m2 and get -1 then your lines are perpendicular.
 
  • #12
Fulham,
If m1 = 0, what is m2? and does m1*m2=-1 help. Read the above few post, where the author of the post has raised this question.

The formula u derived earlier was much better than this (as far as computational overhead is concerned), can u see why? Your earlier formula is closely related even to the vector method and i could even say the results are identical.

Ameed Khan,
Think again , it should m1m2 = -1 and not m1/m2 = -1.

-- AI
 
  • #13
All my apologies. I made a mistake in the formula, and consequently, the explanation became totally untrue. You are right TenaliRaman, the formula should be : -
(m1)*(m2) = -1

I had this in my head, but my mind was quicker than my hands, so I mistyped the formula. My apologies for that.
 
  • #14
Its ok! I have written 3*4=7 many times , so u are doing really good!

-- AI
 

1. How can Cartesian coordinates be used to prove a right angle?

Cartesian coordinates are a system used to locate points on a plane using two perpendicular axes. By plotting the coordinates of three points that form the vertices of a triangle, we can calculate the distances between them using the Pythagorean theorem. If the square of the longest side is equal to the sum of the squares of the other two sides, then the angle formed by those sides is a right angle.

2. What is the Pythagorean theorem?

The Pythagorean theorem is a mathematical equation that states that in a right triangle, the square of the length of the hypotenuse (the side opposite the right angle) is equal to the sum of the squares of the other two sides. It can be written as a² + b² = c², where a and b are the lengths of the shorter sides and c is the length of the hypotenuse.

3. Can Cartesian coordinates be used to prove any type of angle?

Yes, Cartesian coordinates can be used to prove any type of angle. By calculating the distances between the points using the Pythagorean theorem, we can determine the angle formed by those sides. A right angle is just one specific type of angle that can be proven using Cartesian coordinates.

4. Is proving a right angle using Cartesian coordinates a reliable method?

Yes, proving a right angle using Cartesian coordinates is a reliable method. As long as the coordinates of the three points are accurately plotted and the Pythagorean theorem is applied correctly, the result will always be a right angle.

5. Are there any other methods for proving a right angle?

Yes, there are other methods for proving a right angle, such as using the properties of similar triangles or using the definition of a right angle as a 90 degree angle. However, using Cartesian coordinates is a straightforward and reliable method that can be easily applied in many situations.

Similar threads

  • Introductory Physics Homework Help
Replies
8
Views
1K
  • Introductory Physics Homework Help
Replies
21
Views
1K
  • Introductory Physics Homework Help
Replies
1
Views
898
Replies
5
Views
1K
Replies
2
Views
1K
  • Introductory Physics Homework Help
Replies
5
Views
1K
  • Introductory Physics Homework Help
Replies
2
Views
461
  • Introductory Physics Homework Help
Replies
1
Views
2K
  • Introductory Physics Homework Help
Replies
13
Views
1K
  • Electromagnetism
Replies
4
Views
791
Back
Top