4

The formula for finding the area of a triangle $ABC$ with vertices $A$ $(x_1,y_1)$, $B$ $(x_2,y_2)$, and $C$ $(x_3,y_3)$ is given by the following formula:

$$\Delta ABC = \frac 1 2\left|{\begin{array}{ccc} x_1 & y_1 & 1 \\ x_2 & y_2 & 1 \\ x_3 & y_3 & 1 \\ \end{array} } \right|$$

While the magnitude of the RHS gives the area. I don't really understand why the sign of the expression on the RHS changes when we change the rotational sense of the vertices A,B and C. (My book insists to take the vertices in clockwise sense) For example, when we take A,B and C in the clockwise sense, and if the expression turns to be positive, then if we take the vertices A,B and C in the counter-clockwise sense, then its expression is necessarily negative. Why is there a change of sign when we change the sense of rotation about the vertices A,B and C? Further, please explain why the expression is necessarily positive if the vertices are taken in clockwise sense and is negative if vertices are taken in anticlockwise sense.

Vishnu
  • 1,816

3 Answers3

2

Further, please explain why the expression is necessarily positive if the vertices are taken in clockwise sense and is negative if vertices are taken in anticlockwise sense.

Let's reduce the problem slightly - you can use the first point as the origin instead. Geometrically, this is a translation of all the points by a constant vector, and obviously doesn't affect the area. In terms of the determinant, this is achieved by applying the two column operations $$ C_1 \to C_1 - x_1C_3, \\ C_2 \to C_2 - y_1C_3, \\ $$ which do not change the determinant. So without loss of generality we may assume $\binom{x_1}{y_1} = \binom{0}{0}$, and now we need to check $$\frac 1 2\left|{\begin{array}{ccc} 0 & 0 & 1 \\ x_2 & y_2 & 1 \\ x_3 & y_3 & 1 \\ \end{array} } \right| >0? $$ Expanding this determinant (e.g. Laplace expansion along the top row) we obtain $$ \frac 1 2\left|{\begin{array}{ccc} 0 & 0 & 1 \\ x_2 & y_2 & 1 \\ x_3 & y_3 & 1 \\ \end{array} } \right| = \frac 1 2\left|{\begin{array}{cc} x_2 & y_2 \\ x_3 & y_3 \\ \end{array} } \right| = \frac12 \binom{-y_2}{x_2}\cdot\binom{x_3}{y_3}$$

This is maybe easier to interpret if we first assume that we rotated the diagram until the second point lies on the positive part of the $x$ axis. i.e. $y_2=0, x_2 > 0$. Now the determinant is simply

$$ x_2y_3/2 $$ and this is positive iff $y_3$ is positive, which is true iff you took the points in the anticlockwise order - not the clockwise order, as your book said*.

At this point, you can either wave your hands while saying something about rotation matrices having determinant 1, or you can repeat the argument for a general $\binom{x_2}{y_2}$. What does it mean to pick 3 points in counterclockwise order? It means that the third point is on the "left" side of the line joining the first two points. Since the first point is $\binom{0}{0}$, a vector parallel to this line is $\binom{x_2}{y_2}$, and the vector $$ \binom{-y_2}{x_2}$$ is the $90º$ anti-clockwise rotation of $\binom{x_2}{y_2}$. The third point $\binom{x_3}{y_3}$ is on the "left" side of the line iff the dot product of $\binom{x_3}{y_3}$ and $ \binom{-y_2}{x_2}$ is positive, whence the result. (in fact, I might take this as a definition of being on the "left" side...)

enter image description here

PS this is not very far from the full derivation of why this is equal to the area; For the full derivation, you may want to consult the answers here -

Show that the area of a triangle is given by this determinant

Proof the area of a given triangle with coordinates is half determinant

Why determinant of a 2 by 2 matrix is the area of a parallelogram?


*I checked to make sure with this explicit example: $ \tiny \begin{pmatrix} \scriptsize 0 & \scriptsize 0 &\scriptsize 1 \\\scriptsize 1 &\scriptsize 0 &\scriptsize 1 \\ \scriptsize 0 &\scriptsize 1 &\scriptsize 1 \end{pmatrix}$ has determinant 1, and the vertices $(0,0),(1,0),(0,1)$ are indeed taken in the anticlockwise sense. So either you copied something wrong or your book has a typo.

Calvin Khor
  • 34,903
  • Thank you for your answer. May I know how the second and third rows of the determinant are unaffected by the column operation? – Vishnu Oct 19 '19 at 12:55
  • 1
    @Intellex its not that they aren't unaffected, but I performed a change of variables without changing the symbols and then said "without loss of generality". You should rightfully have $x_2 - x_1, x_3 - x_1, y_2 - y_1,$ and $y_3 - y_1$, but then you can just call these, say $\tilde x_2 , \tilde x_3, \tilde y_2, \tilde y_3$ and continue with the argument. Does that help? – Calvin Khor Oct 19 '19 at 12:57
  • Thank you, could you please explain the notation which looks like finding "combination" i.e., two big parenthesis "(" and ")". I know to evaluate 2x2 matrices but haven't seen this expression. – Vishnu Oct 19 '19 at 13:02
  • 1
    $\binom{a}{b}$ is the vector with $x$ coordinate $a$, and $y$ coordinate $b$. People also write $(a,b)$, but I write it as $\binom{a}{b}$ because I'm thinking of it as a $2\times 1$ matrix (a "column vector"), since I like to multiply my vectors with matrices on the left. @Intellex – Calvin Khor Oct 19 '19 at 13:04
  • (I note that Yves' answer is a nice "short and snappy" way to say what I tried to explain here. Commenting on my own answer so as to not bother Yves :) ) – Calvin Khor Oct 19 '19 at 13:22
  • But you've bothered me. I received notification! :) – Vishnu Oct 19 '19 at 13:25
  • 1
    @Intellex I had no clue you'd be pinged if I didn't @ you! Oh well, damage is done... :) – Calvin Khor Oct 19 '19 at 13:26
  • 1
    No problem:) I think the previous poster will automatically be notified even without @username. – Vishnu Oct 19 '19 at 13:27
1

Changing the direction in which the vertices are taken permutes the rows of the $3×3$ matrix, and this is an odd permutation ($123$ becoming $132$ for example). Therefore, by the properties of determinants, the sign flips.

Parcly Taxel
  • 103,344
  • Thanks for your answer. Could you please explain what happens graphically, if possible? – Vishnu Oct 17 '19 at 11:33
  • In my book, it's given that the area is necessarily positive if the vertices are taken in the clockwise sense. After reading your answer, I understood why sign change takes place. It would be great if you could explain why the clockwise sense gives a positive result for sure? – Vishnu Oct 17 '19 at 11:35
  • @Intellex Without the absolute value, the determinant expression gives signed area. Thus the formula explains why the area of a degenerate triangle is $0$. – Parcly Taxel Oct 17 '19 at 11:35
  • I understand that the determinant can also be used to check whether three points are collinear or not when the matrix becomes singular. I also understand it gives signed area. But why should that be positive for clockwise sense and negative for anticlockwise sense for all three non collinear points? – Vishnu Oct 17 '19 at 11:39
  • @Intellex Strictly speaking, that is wrong. The sign also depends on the handedness of the coordinate system. But if you stick to one handedness, then taking all vertices in a given direction always yields an area of a same sign, again by the properties of determinants. – Parcly Taxel Oct 17 '19 at 11:52
  • May I know what do you mean by "handedness of the coordinate system"? – Vishnu Oct 17 '19 at 12:00
  • @Intellex An example of a right-handed system is the standard Cartesian one: $+x$ right, $+y$ up. A left-handed system is the reflection of a right-handed system, such as the one used in my beloved SVG, where $+y$ goes down. – Parcly Taxel Oct 17 '19 at 12:01
  • Thanks, I've fixed that as the cartesian one. Sorry to ask further, could you please explain which property of determinant rules the sign determination, i.e., clockwise is positive? – Vishnu Oct 17 '19 at 12:04
  • @Intellex Just calculate for one case. – Parcly Taxel Oct 17 '19 at 12:05
  • Yes. I did so. Only after that, I posted this question. I wish to know what happens behind the scenes. – Vishnu Oct 17 '19 at 12:06
  • @Intellex There is no "behind the scenes". All these are names we give to whatever numbers show up. – Parcly Taxel Oct 17 '19 at 12:08
  • Ok. Finally please tell whether this statement is correct : When we have fixed the handedness of the coordinate system, we cannot say for sure, the sign of the determinant, if the sense of taking the vertices of the triangle is clockwise? – Vishnu Oct 17 '19 at 12:10
  • @Intellex You can determine it. – Parcly Taxel Oct 17 '19 at 12:11
  • Sorry for reiterating. Given the vertices, I can plug in these values in the determinant and obtain the area (finding the absolute value). That's not at all a problem. Does taking the sense of vertices clockwise (in cartesian coordinate system) predetermine the sign of the determinant? If so which property is related to this here? – Vishnu Oct 17 '19 at 12:17
  • @Intellex Yes, it does. The definition of the determinant fixes it. – Parcly Taxel Oct 17 '19 at 12:26
  • Thank you. It seems I haven't come across such combined properties of Determinants and sense of vertices. Is that covered in university mathematics or school-level one? – Vishnu Oct 17 '19 at 12:28
  • 1
    @Intellex I remember it being covered in first-year university mathematics. The determinant of a matrix is the signed (hyper)volume of a parallelepiped defined by a set of vectors that make up the matrix's columns. – Parcly Taxel Oct 17 '19 at 12:32
1

WLOG, $(x_1,y_1)=(0,0)$ and $(x_2,y_2)=(1,0)$ because you can translate the three points so that $P_1$ becomes the origin, then rotate so that $P_2$ comes on the $x$ axis and scale so that $\|P_1P_2\|=1$. None of these operations changes the sign of the determinant. (Rotation is expressed as a product with an orthogonal matrix, the determinant of which is $1$.)

Then

$$\begin{vmatrix}0&0&1\\1&0&1\\x_3&y_3&1\end{vmatrix}=y_3.$$

Hence the determinant is positive when the third point is to the left of the line from the first to the second.