Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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$.

enter image description here

share|cite|improve this question
up vote 8 down vote accepted

$\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$.

share|cite|improve this answer
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


$ \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$$

share|cite|improve this answer
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.

share|cite|improve this answer

Your Answer


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.