Results 1 to 7 of 7

Thread: Deriving a straight line equation from its slope and distance from origin

  1. #1
    New Member
    Join Date
    Nov 2015
    Posts
    4

    Deriving a straight line equation from its slope and distance from origin

    Hello everyone.
    The only data I have about a straight line is its slope and distance from origin.
    I know that it's easy to use slope to obtain the angular coefficient m if I want line in the form y + mx +c.
    Anyway, I still have no idea about how to find y-intercept c.
    Do you know how I could do that?
    Alternatively, do you know another way to get line's equation starting from slope and distance?

    Thanks for help.

  2. #2
    Elite Member
    Join Date
    Jun 2007
    Posts
    17,576
    Quote Originally Posted by ubisum View Post
    Hello everyone.
    The only data I have about a straight line is its slope and distance from origin.
    I know that it's easy to use slope to obtain the angular coefficient m if I want line in the form y + mx +c.
    Anyway, I still have no idea about how to find y-intercept c.
    Do you know how I could do that?
    Alternatively, do you know another way to get line's equation starting from slope and distance?

    Thanks for help.
    I am assuming that means - perpendicular distance from the origin.

    If that is the case - draw sketch of a line with x-intercept = a and y-intercept = b

    m = tan(180 - Θ) = -b/a

    Drop a perpendicular from the origin (O) to the line - intersecting at P. We know OP = k (given distance)

    and continue .....
    “... mathematics is only the art of saying the same thing in different words” - B. Russell

  3. #3
    New Member
    Join Date
    Nov 2015
    Posts
    4
    Quote Originally Posted by Subhotosh Khan View Post

    I am assuming that means - perpendicular distance from the origin.

    If that is the case - draw sketch of a line with x-intercept = a and y-intercept = b

    m = tan(180 - Θ) = -b/a

    Drop a perpendicular from the origin (O) to the line - intersecting at P. We know OP = k (given distance)

    and continue .....

    Thanks for answer.
    would you explain better how to derive intercept on Y axis, starting from OP distance?

  4. #4
    Full Member
    Join Date
    Aug 2014
    Posts
    384
    Alright so, if you know the slope of the line, and Subhotosh Khan is correct that by "distance from the origin" you actually mean "perpendicular distance from the origin," then let's look at how to find the y-intercept. One form of a line is: Ax + By + C = 0. If you know the slope, then you know A and B (Remember: the slope is A/B), and the only unknown is the y-intercept, or C. Now you also know the perpendicular distance from the origin. The perpendicular distance from a line to a point (m, n) is:

    [tex]d=\frac{\left|Am+Bn+C\right|}{\sqrt{A^2+B^2}}[/tex]

    Plugging in (0,0) as the point, we get:

    [tex]d=\frac{\left|C\right|}{\sqrt{A^2+B^2}}[/tex]

    As established, you know A and B, so solve for C using the known distance d.

  5. #5
    Elite Member
    Join Date
    Jul 2014
    Posts
    3,344
    Quote Originally Posted by Denis View Post
    Btw, there will always be 2 possible y-intercepts.
    Corresponding to the negative y intercept of
    C = [tex]\pm\, d\, * \sqrt{s^2\, +\, 1}[/tex]
    where s is the slope of the original line -s x + y + C = 0.

    EDIT: Change dumb misteak of s to the proper -s in the equation for the line.
    Last edited by Ishuda; 11-18-2015 at 12:49 AM.

    -Ishuda

  6. #6
    New Member
    Join Date
    Nov 2015
    Posts
    4
    Thanks everyone for answering.
    My professor suggested me a solution. He wrote it to me by mail, so I can't tell you how he derived it.
    Given the couple <rho, theta>, where rho is the distance from origin and theta is the angle between the line and X axis, he told me to derive line's coefficents acconding to the following formulae:

    a = cos(theta)
    b = sin(theta)
    c = -rho

    Using this coefficients, I derived that line must certainly pass through points A(-c/a, 0) and B(0, -c/b).
    I should handle cases when a or b are equal to zero, but at the moment I'm just performing a test.

    Do you think all this makes sense?

  7. #7
    New Member
    Join Date
    Nov 2015
    Posts
    4
    Quote Originally Posted by Ishuda View Post
    Corresponding to the negative y intercept of
    C = [tex]\pm\, d\, * \sqrt{s^2\, +\, 1}[/tex]
    where s is the slope of the original line -s x + y + C = 0.

    EDIT: Change dumb misteak of s to the proper -s in the equation for the line.
    I divided the expression under the root operator by [tex]B^2[/tex] and I got [tex]B\sqrt{s^2+1}[/tex]. What happened to [tex]B^2[/tex] in your calculations?

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •