# Find the slope of a line given a point and an angle

I'm trying to figure out this problem and feel like it's something that must be so simple that I could've done in high school no problem, but for some reason my brain is frozen this morning. I would really appreciate any help, and want to say thanks in advance. I tried to draw a picture below; I want to find the slope of a line given a point $(x,y)$ and $\theta$.

-

$\tan \left( \tan^{-1}\left(\frac{y}{x}\right) - \theta\right)$ is the slope $m$.

Then use "point slope formula" (if you want an equation of the line, that is...)

$y-y_1 = m(x - x_1)$

For variety, I'll explain.

Labeling the origin "$O$" and the point $(x, y)$ "$P$", the segment $\overline{OP}$ makes an angle of $\tan^{-1} \left(\frac{y}{x}\right)$ with the positive x-axis. But this is the sum of $\theta$ and the angle $\phi$ that your line makes with the positive x-axis (since we have opposite interior angles).

So $\tan^{-1}\left(\frac{y}{x}\right) - \theta = \phi$.

Finally, $\tan \phi = m$.

-
Thanks for such quick answers. I think I'm still confused about, what if x is 0? – all-too-human Feb 4 '12 at 21:05
If X is 0, arctan(y/x) is 90 degrees. Thus, the formula turns out to be tan(90-$\theta$). You can think of it as pivoted at the Y axis at the point (0,y). Now, as you change $\theta$ from 0 to 90, the angle of the slope of your line changes from inf (Line parallel to X axis) to 0 (Y axis). – Inquest Feb 4 '12 at 21:12
If $x=0$, then consider $m = \tan (90- \theta)$ – The Chaz 2.0 Feb 4 '12 at 21:14
Thanks again, sorry one more question, just to clarify... so, if x is 0, how do we compute arctan(y/x) without dividing by zero? – all-too-human Feb 4 '12 at 21:24
@all-too-human: In fact, atan2 is usually the primitive that the hardware can compute, and runtime libraries then implement the classical atan function as $\mathrm{atan2}(x,1)$. – Henning Makholm Feb 4 '12 at 21:39

Another method: If you know the exterior angle theorem, you know that The exterior angle is the sum of remote interior angles thus:

$\tan^{-1}\frac{y}{x} = \theta +$ unknown angle

thus,

$\tan^{-1}\frac{y}{x} - \theta =$ unknown angle

$\tan(\tan^{-1}\frac{y}{x} - \theta )= \tan($unknown angle) $$\tan(\tan^{-1}\frac{y}{x} - \theta )= Slope$$

-
Thanks for your help – all-too-human Feb 4 '12 at 21:37

The slope is given by the change in y for a given change in x. From trig, you have that the tangent of an angle in a right triangle is the measure of the side of the triangle opposite the angle divided by the measure of the side adjacent to the angle (not the hypotenuse). See diagram.

Then you have $$\tan\theta = \frac{\Delta y}{\Delta x}$$ which is the slope of the line.

-