# How to calculate a perpendicular line?

• B
Hi, i get the math that is involved but if I have only the x,y coordinates for 2 points to connect and if i want to know what will be the perpendicular line to the line connecting these two points, how can I do that?

## Answers and Replies

Doc Al
Mentor
I presume, given those points, that you can find the equation of the line connecting them and its slope. Given that, you can find the slope of the line perpendicular to that one. But there are many such lines.

yes there will be many possible lines.
when i mentioned that i understand the math, the examples given usually has numbers in it like y = 3x+2 but in my case i only have the x and y values, so which formula should i actually use? thanks.

Doc Al
Mentor
when i mentioned that i understand the math, the examples given usually has numbers in it like y = 3x+2
That's the slope-intercept form of the equation for a line: y = mx + b, where m is slope and b is the y-intercept. (Look it up!)

but in my case i only have the x and y values, so which formula should i actually use?
Start by finding the slope.

osilmag
Gold Member
Hi, i get the math that is involved but if I have only the x,y coordinates for 2 points to connect and if i want to know what will be the perpendicular line to the line connecting these two points, how can I do that?

Find the slope connecting those two points (y2-y1/x2-x1). The perpendicular line is the negative inverse.

Last edited:
If the equation of your two points are y = mx+b, the perpendicular line to that will be every line that is
y = -(1/m)x+n where n ∈ ℝ
(Since you only care about if they are perpendicular or not and the line streches infinitely)

Last edited:
The slope of a line perpendicular to another line is just the negative reciprocal of the slope of the other line.

So, if you have a line where m=2, the slope of a line perpendicular to that line would be m=-1/2.

• YoungPhysicist
PeterO
Homework Helper
yes there will be many possible lines.
when i mentioned that i understand the math, the examples given usually has numbers in it like y = 3x+2 but in my case i only have the x and y values, so which formula should i actually use? thanks.
If you have the equation of a line it is pretty simple to find a couple of points on that line.
If you have a couple of points on the line, it is pretty simple to find the equation of that line.
So whether you are starting from the equation o f the line or a couple of points on the line, there is only one extra step to the problem.

i have a line that connects from point A to point B and I am able to compute this line using its x,y coordinates and so now i need to find the slope of this line so that i can compute the line that will be perpendicular to this line.

Doc Al
Mentor
i get this part and i have compute the slope of the line from point A to B. what I don't understand now is the intercept value y=mx + b. I can compute the b value since I now have x, y and m values but should I use this same b value to compute the perpendicular line?

Doc Al
Mentor
i get this part and i have compute the slope of the line from point A to B. what I don't understand now is the intercept value y=mx + b. I can compute the b value since I now have x, y and m values but should I use this same b value to compute the perpendicular line?
As explained above, given two points you can find the equation of the line that connects them. But there is an infinite number of lines perpendicular to that one. Do you want that perpendicular line to intersect the first line at some particular point? Up to you!