Results 1 to 2 of 2

Math Help - [SOLVED] Equation for a point on a line in polar coords

  1. #1
    dmw
    dmw is offline
    Newbie
    Joined
    Mar 2010
    Posts
    13

    [SOLVED] Equation for a point on a line in polar coords

    [FONT=&quot]Suppose we are given the Polar points P1=(r1, θ1) and P2=(r2, θ2) and we are given a distance D1. How would I find the coordinates of the point P3=(r3, θ3) that lies along the line segment between P1 and P2, and is a distance D1 from point P1?

    It would look something like this:

    P1--------------P3----------------------P2
    |------D1-----|

    So we know P1, P2 and distance D1.
    I need a formula to find the point P3.

    I would like to be able to solve this without converting to Cartesian coordinates because it is in a program that needs to loop as fast as possible - I've done it with the conversion and it is just taking too long. Not to mention the minor precision loss.

    Any thoughts?
    Please grace me with your vast knowledge, O' great Internets.
    Last edited by dmw; March 18th 2010 at 05:30 AM.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    dmw
    dmw is offline
    Newbie
    Joined
    Mar 2010
    Posts
    13
    I found the answer.

    For anyone else who might be looking for this solution:

    The coordinates of the point dividing the line segment P1P2 in the ratio a/b are:

    range = (sqrt[b*b*r_1*r_1+a*a*r_2*r_2+2*a*b*r_1*r_2*cos(theta_2-theta_1)]/[a+b]

    theta = arctan([b*r_1*sin(theta_1)+a*r_2*sin(theta_2)]/[b*r_1*cos(theta_1)+a*r_2*cos(theta_2)])

    It looks intimidating, but it isn't. The hardest part is making sure you have the correct sign after calculating arctan(). If you are implementing it in Java, you can use:

    Code:
    tempTheta = Math.atan2(tempRange, tempAz);
    if(tempTheta < 0) tempTheta += (2 * Math.PI);
    Math.atan2(y, x) computes the phase theta by computing an arc tangent of y/x in the range of -pi to pi. In the case of being negative, just add 2*PI.

    For more on Points and Lines in Polar Coordinates, look here: Math Forum: Ask Dr. Math FAQ: Polar Coordinates

    Thanks anyway!
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. cylindrical polar coords
    Posted in the Calculus Forum
    Replies: 1
    Last Post: May 8th 2010, 04:55 AM
  2. Replies: 8
    Last Post: March 17th 2010, 11:50 AM
  3. [SOLVED] equation for a point on a known line
    Posted in the Trigonometry Forum
    Replies: 7
    Last Post: March 16th 2010, 11:53 AM
  4. Polar coords and differentiation
    Posted in the Calculus Forum
    Replies: 0
    Last Post: October 26th 2008, 02:12 PM
  5. Replies: 3
    Last Post: February 20th 2008, 11:17 AM

Search Tags


/mathhelpforum @mathhelpforum