Sign in to follow this  
fguihen

line formulas . point on a line with slope of 0

Recommended Posts

ok, to find if a point is on a line with a slope, i just plug the point into this formula: y - y1 = m (x - x1) what if the slope is 0??? also , if the point is not on the line, or is across the line, what value will be returned?

Share this post


Link to post
Share on other sites
If your line has a slope of 0, it means it is parallel to the x-axis.

So if y matches y1, the point is on the line, no matter what x is.

y - y1 - m * (x - x1) = r

If r is zero, the point is on the line, otherwise it is not.


Edit:

You may choose to write your line equation in vector form.

If you have a normal vector n perpendicular to the line, then you can calculate

<n, x-p> = s

where <.,.> is the dot product, p a point on the line and x the point to test.


If s = 0, then x is on the line.

You can obtain n from m as:

n = (-m, +1/m)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
if the slope is 0 then you just compare y values.

if y = y1 then the point is on the line

Share this post


Link to post
Share on other sites
As AP mentioned, just compare the y values, if the state is true (that is, if the values are equal to eachother) then the point is on the line, else - it is not.

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