Results 1 to 5 of 5

Math Help - EndPoint based on Length and Angle

  1. #1
    Newbie
    Joined
    Apr 2009
    Posts
    3

    EndPoint based on Length and Angle

    Hello everyone,
    I am needing to find a point perpendicular to a line by an offset.
    I'm almost there, but I can't seem to figure out the last piece of the puzzle...

    Line A is a physical line. Line B is a "construction" line and will start at X1,Y1 of Line A. Line B's angle is the angle of Line A + 90. Line B's length is 75. If unit type is important, these are measurments in Feet.

    Line A:
    X1: 2279540.5757 X2: 2279495.2158
    Y1: 841723.9968 Y2: 841750.9777
    Angle: 149.2551

    Line B:
    X1: 2279540.5757 X2: ?
    Y1: 841723.9968 Y2: ?
    Angle: 239.25505248572242
    Length: 75

    I've drawn Line B out and kn0w the answer for X2,Y2 but I need to figure out the formula to put into an application that I am working on.

    X2: 2279502.2344
    Y2: 841659.5380

    I tried this formula that I found on another forum, but the values are off...
    X2 = (75 * Sin(239.2550)) + 2279540.5757
    Y2 = (75 * Cos(239.2550)) + 841723.9968

    Which gives a result of:
    X2: 2279606.6085
    Y2: 841759.5589

    So the results are off by about 100' in both the X and Y.

    Any help with the will be greatly appreciated! Thank you all for your time and help.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member
    Joined
    Jan 2009
    Posts
    591
    Quote Originally Posted by nclayton View Post
    ...

    I tried this formula that I found on another forum, but the values are off...
    X2 = (75 * Sin(239.2550)) + 2279540.5757
    Y2 = (75 * Cos(239.2550)) + 841723.9968

    ... and help.
    You have the concept correct -- just swap the trig functions.

    When working with cartesian coordinates,
    the sin() will give the distance to be added/subtracted to the Y coordinate. Since 239+ degrees is in the third quadrant, the sin value is negative.
    the cos() will give the distance to be added/subtracted to the X coordinate.
    You can look at the sin/cos definitions to clarify this.

    Try this:
    X2 = (75 * cos(239.2550)) + 2279540.5757
    Y2 = (75 * sin(239.2550)) + 841723.9968

    Your calculator should provide the correct sign for the sin/cos values.
    However in this case BOTH the sin/cos values will be negative.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Apr 2009
    Posts
    3
    Thank you for the reply, it has gotten me closer to the answer I need

    I swapped the Cos and Sin and now come up with:

    X2 = (75 * cos(239.2550)) + 2279540.5757
    Y2 = (75 * sin(239.2550)) + 841723.9968

    Replaced with values:

    2279576.1377 = (75 * 0.8804) + 2279540.5757
    841790.0297 = (75 * 0.4742) + 841723.9968

    I am actually using this formula in an application I'm writing in C#. I'm hoping it is giving the correct Cos and Sin values...though they both came back as positive values.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Member pflo's Avatar
    Joined
    Apr 2009
    From
    Albuquerque, NM
    Posts
    155
    Thanks
    7
    Your computer is using radians to measure the angle. But your measurements are in degrees. You'll either need to tell the computer to use degrees or convert the measurements to radians before plugging them in to the sine and cosine functions. Note that there are 2{\pi} radians in 360 degrees.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Apr 2009
    Posts
    3

    Thumbs up

    Quote Originally Posted by pflo View Post
    Your computer is using radians to measure the angle. But your measurements are in degrees. You'll either need to tell the computer to use degrees or convert the measurements to radians before plugging them in to the sine and cosine functions. Note that there are 2{\pi} radians in 360 degrees.

    That was exactly my problem...I was converting the radians to degrees because most of the drafting software I work with uses degrees. I think I've finally got a solid solution to use in my application, thank you guys for all the help!


    Here is what I ended up using...

    If the degrees(angle) is > 0 and < 90:
    x2 = x1 + (offset * Abs(Cos(radians(angle))))
    y2 = y1 + (offset * Abs(Sin(radians(angle))))

    If the degrees(angle) is > 90 and < 180:
    x2 = x1 - (offset * Abs(Cos(radians(angle))))
    y2 = y1 + (offset * Abs(Sin(radians(angle))))

    If the degrees(angle) is > 180 and < 270:
    x2 = x1 - (offset * Abs(Cos(radians(angle))))
    y2 = y1 - (offset * Abs(Sin(radians(angle))))

    If the degrees(angle) is > 270 and < 360:
    x2 = x1 + (offset * Abs(Cos(radians(angle))))
    y2 = y1 - (offset * Abs(Sin(radians(angle))))

    If the degrees(angle) = 0:
    x2 = x1 + offset
    y2 = y1

    If the degrees(angle) = 90:
    x2 = x1
    y2 = y1 + offset

    if the degrees(angle) = 180:
    x2 = x1 - offset
    y2 = y1

    If the degrees(angle) = 270:
    x2 = x1
    y2 = y1 - offset

    Again, thank you all for the help
    Last edited by nclayton; April 30th 2009 at 12:47 PM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. square based pyramid angle
    Posted in the Trigonometry Forum
    Replies: 4
    Last Post: December 10th 2010, 05:49 PM
  2. Replies: 2
    Last Post: October 15th 2009, 10:15 PM
  3. Angle between 2 points, based off north
    Posted in the Trigonometry Forum
    Replies: 8
    Last Post: April 9th 2009, 08:43 AM
  4. Replies: 1
    Last Post: February 3rd 2008, 07:52 PM
  5. Replies: 1
    Last Post: July 9th 2007, 03:51 AM

Search Tags


/mathhelpforum @mathhelpforum