0
$\begingroup$

I am trying to calculate the angle, slope and intercept of line 3 which is 60 degrees or pi/3 away from line 1. I know that information for the other lines.

Image of Graph

x1 = 652 
x2 = 1017 
y1 = 194
y2 = 632

p.pos <- data.frame(x1,x2,y1,y2)

## Line 1 information 
angle.l1 = 1.565595
slope.l1 = 1.2
intercept.l1 = -588.4

## Line 2 information
angle.l2 = 0.5183978
slope.l2 = 0.5704363
intercept.l2 = 51.8663

Thanks in advance

  • 0
    slope $m=\tan(\tan^{-1}(1.2)+\pi/6)$2017-01-14
  • 0
    Thanks boris. would tan−1(1.2) = -1.86888926959 ?2017-01-14
  • 0
    its 50.19 degree or .87 radian,$m=-2.71$,Is the above data written in R language2017-01-14
  • 0
    When I am converting your equation to R the tan -1 doesn't work. I have now done: m = tan(-tan(1.2) + (pi/6)) = 1.931387 Do you know how you would write your answer in R?2017-01-14
  • 0
    you can write **tan(atan(1.2)+3.14/6)** in R2017-01-14
  • 0
    If line 3 is really 60° counterclockwise from line 1, it’s going to be sloped downward instead of upward as you’ve pictured it.2017-01-15

1 Answers 1

0

Use the formula for the tangent of a sum of angles to find the slope of line 3: $$\tan(\alpha+\beta)={\tan\alpha+\tan\beta\over1-\tan\alpha\tan\beta}.$$ (If going clockwise instead, use the difference formula, which just swaps the $+$ and $-$ in this formula.) You have $\tan\alpha = \text{slope.l1} = 1.2$ and $\tan\beta=\tan{60°}=\sqrt3$, so $m_3=\text{slope.l3}=\tan(\alpha+60°)\approx-2.72$. Once you have the line’s slope, it’s a simple matter to find its $y$-intercept. Since you know that it passes through $(x,y)_2$, an equation for the line is $y-y_2=m_3(x-x_2)$. Setting $x=0$ gives $y_2-m_3x_2$ for the line’s $y$-intercept.