Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

OK, I have a picture which will hopefully make my explanation a bit clearer.

Image explaining my problem

I have a line (a, b) to (x, y) and all I know is the end points of the line.

I am trying to draw a line from the end point of the original line.

It will have an angle of theta from the original line and a length of l.

Based on these two values I need to work out the coordinates of the end point of this new line.

Length l can be any positive value. Angle theta can lie anywhere from -80 degrees to +80 degrees.

Thanks for any help you can provide.

::Gets out pen and paper and starts scribbling::

share|improve this question
    
What have you tried? –  Américo Tavares Dec 5 '12 at 23:08
    
Hi, I'm just coming up with a possible solution at the moment. Didn't know where to start to begin with, getting there now though. –  Fogmeister Dec 5 '12 at 23:09
add comment

2 Answers

up vote 1 down vote accepted

First, find the x and y components of the line from (a,b) to (x,y).

If we draw a horizontal line from (x,y), we can see that the angle between the extension of the (a,b) to (x,y) line and the horizontal is equal to angle Q because they are alternate interior angles. Since we're given angle R, the angle between the line from (x,y) to (c,d) and the horizontal is Q - R.

Now that we have that angle, we can find the x and y components of the second line segment. The x component is $l \cos(R-Q)$ and the y component is $l \sin(Q-r)$.

Adding components, we find that if (a,b) is the origin, (c,d) is at: $$(x+l \cos(R-Q), y+l \sin(Q-R))$$

If (a,b) is not at the origin, we simply shift (c,d):

$$(c,d) = (a+x+l \cos(R-Q), b+y+l \sin(Q-R))$$

Note: $\angle Q = Tan^{-1}(y/x)$

Triangles

share|improve this answer
    
That's a much more concise version of what I came up with! Thanks :D (I'll add my answer anyway, but I've accepted yours). –  Fogmeister Dec 5 '12 at 23:21
add comment

OK, so after a lot of scribbling...

I came up with this...

enter image description here

The dotted lines represent lines parallel to the x and y axes.

OK, so.

m = x - a n = y - b

alpha = inverse tan (n/m)

so...

beta = alpha - theta

(oops, I forgot length l of the new line)

p = l cos(beta) q = l sin(beta)

SOOOOO...

c = x + p d = y + q

Phew!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.