3
$\begingroup$

enter image description here

I want to determine whether the measure of angle Q is greater than 90 degrees.

$\endgroup$
3
  • 3
    $\begingroup$ it's less than 90 degrees ;-) $\endgroup$
    – JPi
    Mar 6, 2014 at 12:34
  • 1
    $\begingroup$ Suggestion - use the cosine rule $\endgroup$ Mar 6, 2014 at 12:35
  • $\begingroup$ If the lines are not perpendicular, then there always be an angle greater than $\;90^\circ\;$ and one less than that between them...One way to avoid this double result is to look at the inner prodcut definition of the cosine when we decide what vectors to take. $\endgroup$
    – DonAntonio
    Mar 6, 2014 at 12:37

3 Answers 3

11
$\begingroup$

Calculate as follows (in C# or any similar language):

 ux = x2 - x1  ;  uy = y2 - y1;   // u = (ux,uy) = vector from p1 to p2
 vx = x3 - x1  ;  vy = y3 - y1;   // v = (vx,vy) = vector from p1 to p3
 d = ux*vx + uy*vy;               // Dot product of u and v

So, the number $d$ is the dot product of the vectors $ \mathbf{u} =\mathbf{p}_2 - \mathbf{p}_1$ and $\mathbf{v} = \mathbf{p}_3 - \mathbf{p}_1$. If $ d<0$, then the angle between the vectors $\mathbf{u}$ and $\mathbf{v}$ is greater than 90 degrees. If you actually want to find the angle, it's a bit more work (but that's not what you asked).

$\endgroup$
1
$\begingroup$

Form the vectors (x3 - x1, y3 - y1) and (x2 - x1, y2 - y1) and take the dot product. The dot product, from there you can get cosine of the angle between the vectors.

$\endgroup$
0
$\begingroup$

Why do not trying: $$ \cos(Q), $$ if it is greater than $0$ the angle is between $0$ and $\pi/2$, otherwise it is between $\pi/2$ and $\pi$.

$\endgroup$
2
  • $\begingroup$ What about tan(Q) ? $\endgroup$ Mar 6, 2014 at 12:38
  • $\begingroup$ You can use it as well, but if the angle is exactly $\pi/2$ you have a not defined $\tan(\pi/2)$. If you're sure a priori that the angle will not be $\pi/2$ it is equivalent to use bot cosine and tangent functions. $\endgroup$
    – 7raiden7
    Mar 6, 2014 at 12:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .