Sign in to follow this  
MARS_999

Calculate Slope with only three points?

Recommended Posts

Is it possible to calculate the slope of a line with x1,x2, y1 and no y2?

I thought I read somewhere you could use tan() to get the slope of a line?

What I am looking for is the end point on this line. the Y value.

Thanks

Share this post


Link to post
Share on other sites
Nope. There are an infinite number of lines that run through point (x1,y1) and cross the axis x=x2. tan() won't help you here, since tan() is a ratio of rise/run (slope), but the numerator includes an unknown. If you know the angle of the line you could calculate it, otherwise you need more information.

Share this post


Link to post
Share on other sites
[quote name='JTippetts' timestamp='1339645680' post='4949038']
Nope. There are an infinite number of lines that run through point (x1,y1) and cross the axis x=x2. tan() won't help you here, since tan() is a ratio of rise/run (slope), but the numerator includes an unknown. If you know the angle of the line you could calculate it, otherwise you need more information.
[/quote]

say the angle is 27.5 degrees... How would I use that with the 3 coordinates?

Thanks

Share this post


Link to post
Share on other sites
Refer to the old high school rule of SOH CAH TOA, which relates the trigonometric functions relative to a right triangle:

[img]http://i.imgur.com/JjD9i.png[/img]

the sin() of Angle is calculated as Opposite/Hypotenuse (S=O/H)
the cos() of Angle is calculated as Adjacent/Hypotenuse (C=A/H)
the tan() of Angle is calculated as Opposite/Adjacent (T=O/A)

If your line is the hypotenuse in the above triangle, and the Angle=27.5 degrees, then it follows that tan(27.5) = O/A. Side A represents the length of the distance between x1 and x2, side O represents the distance between y1 and y2. So:

tan(27.5) = (y2-y1) / (x2-x1)

Rearrange and solve for y2 (the unknown):

tan(27.5)*(x2-x1)+y1=y2

Share this post


Link to post
Share on other sites
Just to clarify, the concept you're referring to seems unclear. The title of your post says "Calculate Slope with only three points". It's totally possible if you use the conventional meaning of a point, e.g. an x and y co-ordinate. That would mean you have (x1, y1), (x2, y2) and (x3, y3). That's more than you need, you only need two points to get a slope.

If you're talking about two x co-ordinates and one y co-ordinate... that's 1.5 points. Not possible at all. It's not really a situation which comes up often. You can see it by trying to sketch it on paper. To have a slope you need a line. How do you draw a line with less than two points?

If you indeed have a situation where this is a valid question, we need more background on how you ended up in this situation. Sometimes an assumption can be made, or other known data can be used.

Share this post


Link to post
Share on other sites
If all you have is A(x, y) and B(x, ?) you simply don't have enough data. There are an infinite number of lines that pass through A(x,y) and the boundary B(x, ?).

You can set ? to any value and create a line, but there is no single specific line.
If you have an angle already, then JTippets post explains how to solve for ?.

Share this post


Link to post
Share on other sites
The slope m for a line going through the points A (x[sub]1[/sub], y[sub]1[/sub]), and B (x[sub]2[/sub], R), where R is unknown, is simply:

m = (R - y[sub]1[/sub]) / (x[sub]2[/sub] - x[sub]1[/sub])

If you don't know R, you [b]cannot[/b] find m, as others have said. It's like if I tell you j = k, and ask you to find j. You can't. Not without knowing k first.

Think of it like this: B is a line in the form x[sub]2[/sub] (or in other words, it's a vertical line at x[sub]2[/sub]). Start at point A. Now look at your vertical line B. There are an [b]infinite[/b] number of ways to draw a line from A to B, seeing as B is infinitely long. Edited by Cornstalks

Share this post


Link to post
Share on other sites
[quote name='MARS_999' timestamp='1339719252' post='4949364']
So point being is you need to know at least 4 points then... e.g. 3 points define a line, 4 define slope then...
[/quote]

No, your terminology is wrong. A point is two co-ordinates (x and y). You need two points to make a line. A line has a slope. When you have one point plus a single co-ordinate it is impossible to draw a line, so you can't have a slope. Or to be more accurate you could draw an infinite number of lines. Seriously, sketch it on paper and you'll get it.

Share this post


Link to post
Share on other sites
@MARS_999: uhhh... no. Let's clarify something: when you have (x, y) = P, x and y are [b]not[/b] points. [i]Together[/i], they make up a [b]single[/b] point, P. You need [b]both[/b] of them to have [i]one[/i] point.

2 points make up a line (in 2D our case, this requires [b]4[/b] values). Once you have a line, you can find the slope (no additional points required).

If you do not have two points, you do not have a line. If you are missing one of the coordinate values, it is [b]not[/b] a point (i.e. (x, ?) is [b]not[/b] a point). You need [b]two[/b] values to have a point, and you need [b]two[/b] points ([b]four[/b] values) to have a line, and you need a line to have a slope. Edited by Cornstalks

Share this post


Link to post
Share on other sites
Your definition of "point" is off. A point in a 2d plane consists of two coordinates. Two such points define a line.

Share this post


Link to post
Share on other sites
Thanks guys. I see now, yeah I was a bit loose on my wording, saying 4 points should have said elements or coordinates... Axes something...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this