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

Given the following image:

$\hskip{1.5 in}$ enter image description here

Supposing $A(100, 300)$ and $B(300, 100)$, how can I find the angle $\alpha$ between A and B?

On a side note, what's the main difference between a point and a vector? translating a point to a vector is as simple as Point = Vector? Sometimes I find articles where the terms are interchangable

share|cite|improve this question
Your image shows that you are asking for the angle at the origin – Henry Apr 3 '12 at 20:49
ok, how should I edit my main question in order to describe that I want to know angle alpha? Thank you :) – aljndrrr Apr 3 '12 at 20:52
up vote 5 down vote accepted

Hint: You may have been taught about the dot product, perhaps something like $$\mathbf{a} \cdot \mathbf{b}=\left\|\mathbf{a}\right\| \, \left\|\mathbf{b}\right\| \cos \theta$$ so how might you apply that here?

share|cite|improve this answer
so it's $\theta = \arccos((\mathbf{a} \cdot \mathbf{b})/(\left\|\mathbf{a}\right\| \, \left\|\mathbf{b}\right\|))$ ? – aljndrrr Apr 3 '12 at 22:09
Yes (though you might want to take care about the sign) – Henry Apr 3 '12 at 22:18

The Atan2 function in most computer languages will take the coordinates of a point and give the angle from the origin to that point. If you take Atan2$(B_x,B_y)-$Atan2$(A_x,A_y)$ you will have it, to within multiples of $2\pi$. If you use the usual arctangent you need to worry about which quadrant you are in.

Points are exactly that, locations in the plane (in 2D). Vectors are things with a length and a direction. You can make a correspondence between a point and the vector from the origin to that point, which seems to be what you are doing. But a vector can also be from (1,2) to (4,8), for example. This vector has coordinates (3,7).

share|cite|improve this answer

Let $A={A_x \choose A_y}$. Then you subtract the angle $\angle A$ (between $A$ and the $x$-axis) from $\angle B$ (the angle between $B$ and the $x$-axis).

Use the inverse of $\tan(\angle A)=\frac{A_y}{A_x}$ to get $\alpha= \tan^{-1}(\frac{A_y}{A_x})-\tan^{-1}(\frac{B_y}{B_x})$.

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.