Results 1 to 9 of 9

Math Help - [SOLVED] A point that divides a line segment in a given ratio in polar

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

    [SOLVED] A point that divides a line segment in a given ratio in polar

    Say we are given the Cartesian points P1=(x1, y1) and P2=(x2, y2).

    P1-------------------P3-----------------------------------P2
    |----------m--------| |----------------n-------------------|

    We want to find the coordinates of P3. Use this formula:

    ([n*x_1 + m*x_2]/[m+n] , ([n*y_1 + m*y_2]/[m+n])


    Now what if the points were in polar: P1=(r1, theta1) and P2=(r2, theta2). What is the equivalent equation for polar coordinates?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    skeeter's Avatar
    Joined
    Jun 2008
    From
    North Texas
    Posts
    11,694
    Thanks
    450
    Quote Originally Posted by dmw View Post
    Say we are given the Cartesian points P1=(x1, y1) and P2=(x2, y2).

    P1-------------------P3-----------------------------------P2
    |----------m--------| |----------------n-------------------|

    If we want to find the coordinates of P3, we can use the formula:






    Now what if the points were in polar: P1=(r1, theta1) and P2=(r2, theta2). What would be the equivalent equation for polar coordinates?
    make the following changes to your formula ...

    x_1 = r_1\cos{\theta_1}<br />

    y_1 = r_1\sin{\theta_1}

    x_2 = r_2\cos{\theta_2}

    y_2 = r_2\sin{\theta_2}

    note that the result will be in rectangular coordinates ... you'll need to change back to polar if that's what you desire.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    dmw
    dmw is offline
    Newbie
    Joined
    Mar 2010
    Posts
    13
    My current implementation does just what you are suggesting: convert the polar coordinates to cartesian, do the calculation, convert back to polar. This is an extra step that I would like to avoid because it is embedded in a radar simulation program that is making tundreds of thousands of calculations every 12 seconds. This would be a huge number crunching power savings.

    Your quote even says "work smart, not hard." I would like to make my program work smart, not hard.

    Can anyone else help me out?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Senior Member Tinyboss's Avatar
    Joined
    Jul 2008
    Posts
    433
    Is there some difficulty with converting P1,P2 to cartesian, plugging into the above formula, and converting the resulting expression to polar?
    Follow Math Help Forum on Facebook and Google+

  5. #5
    MHF Contributor
    skeeter's Avatar
    Joined
    Jun 2008
    From
    North Texas
    Posts
    11,694
    Thanks
    450
    Quote Originally Posted by dmw View Post
    My current implementation does just what you are suggesting: convert the polar coordinates to cartesian, do the calculation, convert back to polar. This is an extra step that I would like to avoid because it is embedded in a radar simulation program that is making tundreds of thousands of calculations every 12 seconds. This would be a huge number crunching power savings.

    Your quote even says "work smart, not hard." I would like to make my program work smart, not hard.

    Can anyone else help me out?

    this link may help (scroll down to the section titled Points) ...

    Math Forum: Ask Dr. Math FAQ: Polar Coordinates
    Follow Math Help Forum on Facebook and Google+

  6. #6
    MHF Contributor
    skeeter's Avatar
    Joined
    Jun 2008
    From
    North Texas
    Posts
    11,694
    Thanks
    450
    Quote Originally Posted by Tinyboss View Post
    Is there some difficulty with converting P1,P2 to cartesian, plugging into the above formula, and converting the resulting expression to polar?
    apparently, there is ...

    http://www.mathhelpforum.com/math-he...ven-ratio.html

    ... although the OP won't tell you that until after the fact.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    dmw
    dmw is offline
    Newbie
    Joined
    Mar 2010
    Posts
    13
    .
    Last edited by dmw; March 18th 2010 at 04:25 AM.
    Follow Math Help Forum on Facebook and Google+

  8. #8
    dmw
    dmw is offline
    Newbie
    Joined
    Mar 2010
    Posts
    13
    The problem is that I am making this calculation thousands of time per second in a radar simulation program and if I can help it, I would like to not waste system resources on unnecessary conversions. I found the answer by the way.

    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+

  9. #9
    dmw
    dmw is offline
    Newbie
    Joined
    Mar 2010
    Posts
    13
    .
    Last edited by dmw; March 18th 2010 at 04:25 AM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 1
    Last Post: June 1st 2011, 06:10 AM
  2. Finding ratio in which a point divides a line?
    Posted in the Advanced Algebra Forum
    Replies: 0
    Last Post: June 9th 2010, 12:04 AM
  3. Replies: 1
    Last Post: March 18th 2010, 04:29 AM
  4. Vectors and point on the line segment.. (3d)
    Posted in the Calculus Forum
    Replies: 3
    Last Post: December 11th 2008, 04:02 AM
  5. Mid point of a line segment
    Posted in the Geometry Forum
    Replies: 6
    Last Post: June 17th 2008, 10:16 PM

Search Tags


/mathhelpforum @mathhelpforum