Linear AlgebraDeterminants1 of 6
Determinants · 1

The Determinant as Signed Area

A linear map stretches and tilts the grid, and the determinant is the single number that tells us how much every area changes.

1

The Determinant as Area Scaling

Start with the 1×11 \times 1 unit square framed by the green\firstArrow{\text{green}} basis arrow at (1,0)\firstArrow{(1, 0)} and the pink\secondArrow{\text{pink}} basis arrow at (0,1)\secondArrow{(0, 1)}. The determinant of a 2×22 \times 2 matrix tells us what factor the linear map multiplies that square's area by, and every other shape on the grid scales by that exact same factor.

The Determinant as Area Scaling
[3112]\displaystyle \begin{bmatrix} \firstArrow{3} & \secondArrow{1} \\ \firstArrow{1} & \secondArrow{2} \end{bmatrix}
3×2−1×1\displaystyle \firstArrow{3} \times \secondArrow{2} - \secondArrow{1} \times \firstArrow{1} =5\displaystyle = 5
what is this 5 ?\displaystyle \text{what is this } 5\,?

Because we only need to watch what happens to that one starting square, we can read the determinant of several common maps right off the grid without using a formula:

2

Negative Determinants and Orientation

A negative determinant means the map flipped the rubber sheet over to its back side, reversing the turn from the green\firstArrow{\text{green}} arrow to the pink\secondArrow{\text{pink}} arrow from counter-clockwise to clockwise.

Negative Determinants and Orientation
11
determinant=−3  ?\text{determinant} = -3\;?

Together, the sign and the number give the signed area of the transformed unit square:

determinant\displaystyle \text{determinant} =−⏟sheet flipped(clockwise)3⏟area multipliedby 3\displaystyle = \underbrace{-}_{\substack{\text{sheet flipped} \\ \text{(clockwise)}}} \underbrace{3}_{\substack{\text{area multiplied} \\ \text{by } 3}}

Tracking both the unit square's size and whether the sheet flipped gives the determinant of any rotation or reflection right away:

Sliding the pink\secondArrow{\text{pink}} arrow at a fixed height above the green\firstArrow{\text{green}} arrow shears the parallelogram without changing its area. The instant the pink\secondArrow{\text{pink}} arrow crosses the line of the green\firstArrow{\text{green}} arrow, every shape flattens to area 00 and then opens up on the back side of the sheet, with a clockwise turn and a negative determinant.

Sliding the pink arrow parallel to the green arrow tilts every shape without changing its area, while crossing the green arrow’s line collapses the sheet flat and flips it to its back side.
3

Why the 2×22 \times 2 Formula Works

When both basis arrows land at slanted coordinates like (3,1)\firstArrow{(3, 1)} and (1,2)\secondArrow{(1, 2)}, we can't just read off base times height, so we find the parallelogram's signed area by pairing each arrow's horizontal part with the other arrow's vertical part.

Why the 2×2 Formula Works
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
4\htmlClass{lc-mute}{4}
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
[31]\htmlClass{lc-green}{\begin{bmatrix} 3 \\ 1 \end{bmatrix}}
[12]\htmlClass{lc-pink}{\begin{bmatrix} 1 \\ 2 \end{bmatrix}}
??
Text solution
Upright area (green-right by pink-up)The horizontal part of the green\firstArrow{\text{green}} arrow and the vertical part of the pink\secondArrow{\text{pink}} arrow meet in counter-clockwise order to form an unflipped rectangle.
upright area\displaystyle \text{upright area} =3×2\displaystyle = \firstArrow{3} \times \secondArrow{2} =6\displaystyle = 6
Flipped area (pink-right by green-up)The horizontal part of the pink\secondArrow{\text{pink}} arrow and the vertical part of the green\firstArrow{\text{green}} arrow are crossed over in clockwise order, narrowing the parallelogram.
flipped area\displaystyle \text{flipped area} =1×1\displaystyle = \secondArrow{1} \times \firstArrow{1} =1\displaystyle = 1
Subtract the flipped piece from the upright pieceTaking the upright area minus the flipped area gives the total signed area of the parallelogram.
determinant\displaystyle \text{determinant} =6−1\displaystyle = 6 - 1 =5\displaystyle = 5

Writing the green\firstArrow{\text{green}} arrow (a,c)\firstArrow{(a, c)} and the pink\secondArrow{\text{pink}} arrow (b,d)\secondArrow{(b, d)} as the two columns of a matrix gives the general 2×22 \times 2 determinant formula:

det⁡[abcd]=ad⏟upright area(green-right×pink-up)−bc⏟flipped area(pink-right×green-up)\displaystyle \det \begin{bmatrix} \firstArrow{a} & \secondArrow{b} \\ \firstArrow{c} & \secondArrow{d} \end{bmatrix} = \underbrace{\firstArrow{a}\secondArrow{d}}_{\substack{\text{upright area} \\ (\firstArrow{\text{green-right}} \times \secondArrow{\text{pink-up}})}} - \underbrace{\secondArrow{b}\firstArrow{c}}_{\substack{\text{flipped area} \\ (\secondArrow{\text{pink-right}} \times \firstArrow{\text{green-up}})}}

Swapping the two arrows trades the upright and flipped pieces (bc−ad\secondArrow{b}\firstArrow{c} - \firstArrow{a}\secondArrow{d}), keeping the exact same parallelogram while flipping the sheet over and reversing the sign.

Whenever the two basis arrows cross over, the flipped rectangle bc\secondArrow{b}\firstArrow{c} grows larger than the upright rectangle ad\firstArrow{a}\secondArrow{d}, so ad−bc\firstArrow{a}\secondArrow{d} - \secondArrow{b}\firstArrow{c} automatically turns negative.

The parallelogram’s signed area is always the upright rectangle from green-right and pink-up minus the flipped rectangle from pink-right and green-up that cuts into it.
4

Finding Areas of Ellipses and Triangles

Now we want to find the geometric area of a slanted ellipse formed by transforming a circle, and the area of a triangle whose corners do not sit at the origin.

Finding Areas of Ellipses and Triangles
det⁡[3112]=5\det \begin{bmatrix} \htmlClass{lc-green}{3} & \htmlClass{lc-pink}{1} \\ \htmlClass{lc-green}{1} & \htmlClass{lc-pink}{2} \end{bmatrix} = 5
π\pi
??

When the matrix [3112]\begin{bmatrix} \firstArrow{3} & \secondArrow{1} \\ \firstArrow{1} & \secondArrow{2} \end{bmatrix} (with determinant 55) transforms a unit circle of area π\pi into a slanted ellipse, it scales the circle's area by the same factor of 55 as the unit square:

ellipse area\displaystyle \text{ellipse area} =5×π\displaystyle = 5 \times \pi =5π\displaystyle = 5\pi

For the triangle with corners at (1,2)(1, 2), (4,3)(4, 3), and (2,4)(2, 4), sliding the shape to the origin lets us use the determinant on its two side arrows:

1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
4\htmlClass{lc-mute}{4}
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
4\htmlClass{lc-mute}{4}
(1,2)(1, 2)
(4,3)(4, 3)
(2,4)(2, 4)
the triangle
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
4\htmlClass{lc-mute}{4}
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
4\htmlClass{lc-mute}{4}
(0,0)(0, 0)
(3,1)\htmlClass{lc-green}{(3, 1)}
(1,2)\htmlClass{lc-pink}{(1, 2)}
slid so (1,2)(1, 2) sits at (0,0)(0, 0)
Text solution
Find the arrows from one corner to the other twoSliding the triangle so the starting corner (1,2)(1, 2) moves to (0,0)(0, 0) leaves its area unchanged and gives the two side arrows at the origin.
green arrow=(4−1,  3−2)=(3,1)pink arrow=(2−1,  4−2)=(1,2)\displaystyle \begin{aligned} \firstArrow{\text{green arrow}} &= (4 - 1,\; 3 - 2) \\ &= \firstArrow{(3, 1)} \\ \secondArrow{\text{pink arrow}} &= (2 - 1,\; 4 - 2) \\ &= \secondArrow{(1, 2)} \end{aligned}
Find the area of the parallelogram between the two arrowsThe two arrows frame a parallelogram whose area is their determinant.
parallelogram area\displaystyle \text{parallelogram area} =(3×2)−(1×1)\displaystyle = (\firstArrow{3} \times \secondArrow{2}) - (\secondArrow{1} \times \firstArrow{1}) =6−1\displaystyle = 6 - 1 =5\displaystyle = 5
Take half for the triangleCutting the parallelogram along its diagonal gives the triangle, so its area is half of the parallelogram's area.
triangle area\displaystyle \text{triangle area} =12×5\displaystyle = \frac{1}{2} \times 5 =2.5\displaystyle = 2.5

If a determinant comes out negative, either because a matrix flipped the sheet or because you picked the triangle's corners in clockwise order, just drop the minus sign when you want the positive geometric area.

5

Determinants as Volume in 3D

In 3D, the determinant of a 3×33 \times 3 matrix tells us what factor the map multiplies the volume of the 1×1×11 \times 1 \times 1 unit cube by, and every other 3D volume scales by that same factor, with a minus sign when space flips from right-handed to left-handed.

Determinants as Volume in 3D
11

The three columns of a 3×33 \times 3 matrix tell us where the three basis arrows land, stretching and tilting the unit cube into a slanted 3D box called a parallelepiped:

When the third basis arrow lies in the flat plane of the first two, the parallelepiped flattens to volume 00; passing through that plane to the other side turns the box inside out from right-handed to left-handed and gives a negative determinant.

Depending on which side of the first two arrows’ plane the third arrow is on, the 3D box stays right-handed, squishes flat to zero volume, or turns inside out to left-handed with negative volume.
6

Matrix Products, Inverses, and Collapsed Space

Now we want to know how areas or volumes scale when one linear map follows another, and when a map A\theMap{A} can be run backward, so that Ax=b\theMap{A}\point{x} = \point{b} has a single starting point x\point{x}.

Matrix Products, Inverses, and Collapsed Space
det⁡A=2det⁡B=3det⁡(BA)=  ?\displaystyle \begin{aligned} \det \theMap{A} &= 2 \\ \det \theMap{B} &= 3 \\ \det(\theMap{B}\theMap{A}) &= \;? \end{aligned}

If map A\theMap{A} scales every area by det⁡A\det \theMap{A} and map B\theMap{B} scales every area by det⁡B\det \theMap{B}, applying A\theMap{A} followed by B\theMap{B} multiplies areas by both factors in turn:

det⁡(BA)\displaystyle \det(\theMap{B}\theMap{A}) =(det⁡B)(det⁡A)\displaystyle = (\det \theMap{B})(\det \theMap{A})

The determinant also tells us immediately whether a matrix A\theMap{A} has an inverse so we can reverse Ax=b\theMap{A}\point{x} = \point{b}:

When det⁡A=0\det \theMap{A} = 0 squishes the 2D grid onto a single line, a target point b\point{b} off that line is never reached (no solutions), while a target point b\point{b} on that line has a whole line of starting points x\point{x} squished onto it at once (infinitely many solutions).

When the determinant is zero, the whole grid squishes onto one line, so any output point comes from either a whole line of starting points or none at all.

Key concepts

Before using the 2×22 \times 2 formula, check whether you can see what happens to the unit square (or unit cube) directly. If a map is a horizontal shear (det⁡=1\det = 1), a rotation (det⁡=1\det = 1), a reflection across a line (det⁡=−1\det = -1), a simple axis stretch, or a projection that collapses space onto a line or plane (det⁡=0\det = 0), read the area scaling and orientation flip straight off the grid without setting up a matrix calculation.

When the two basis arrows land at general coordinates (a,c)\firstArrow{(a, c)} and (b,d)\secondArrow{(b, d)}, compute upright area minus flipped area:

det⁡[abcd]=ad−bc,det⁡[3112]=(3×2)−(1×1)=5\displaystyle \begin{aligned} \det \begin{bmatrix} \firstArrow{a} & \secondArrow{b} \\ \firstArrow{c} & \secondArrow{d} \end{bmatrix} &= \firstArrow{a}\secondArrow{d} - \secondArrow{b}\firstArrow{c}, \\ \det \begin{bmatrix} \firstArrow{3} & \secondArrow{1} \\ \firstArrow{1} & \secondArrow{2} \end{bmatrix} &= (\firstArrow{3} \times \secondArrow{2}) - (\secondArrow{1} \times \firstArrow{1}) = 5 \end{aligned}

The number gives the factor that every area (or 3D volume) gets multiplied by, while a minus sign means the sheet flipped to clockwise orientation (or 3D space flipped from right-handed to left-handed). To find the geometric area of a transformed shape, drop any minus sign and multiply the original area by the scaling factor, so a circle of area π\pi under a map with determinant −5-5 becomes an ellipse of area 5π5\pi. For a triangle with corners not at the origin, subtract one starting corner from the other two to slide it to (0,0)(0, 0), find the positive area of the parallelogram between those two arrows, and multiply by 12\frac{1}{2}.

Finally, applying one map after another multiplies their scaling factors, det⁡(BA)=(det⁡B)(det⁡A)\det(\theMap{B}\theMap{A}) = (\det \theMap{B})(\det \theMap{A}). As long as det⁡A≠0\det \theMap{A} \neq 0, space does not collapse and A\theMap{A} is invertible; when det⁡A=0\det \theMap{A} = 0, space collapses onto a line or plane so A\theMap{A} has no inverse, leaving Ax=b\theMap{A}\point{x} = \point{b} with no solutions when b\point{b} sits off the collapsed space and infinitely many solutions when b\point{b} sits on it.

7

Practice

1

Without doing any calculation, give the determinant of each linear map in the plane: (a) a horizontal shear, (b) a counter-clockwise rotation by 37∘37^\circ, (c) a reflection across the line y=2x\theMap{y = 2x}, and (d) a projection that collapses the whole plane onto the line y=x\collapsedLine{y = x}.

For each map, ask two questions about the 1×11 \times 1 unit square: what is its new area, and did the rubber sheet flip over to its back side?

(a)A horizontal shear slides the top of the unit square sideways while keeping its base at 11, its height at 11, and the turn from green\firstArrow{\text{green}} to pink\secondArrow{\text{pink}} counter-clockwise: 11.
(b)A rotation turns the unit square on the grid without changing its area or flipping the sheet (using the angle 37∘37^\circ to guess 3737 or setting up sines and cosines confuses the rotation angle with the area scaling factor): 11.
(c)A reflection across y=2x\theMap{y = 2x} keeps the unit square's area at 11 but flips the rubber sheet over to clockwise orientation (forgetting that a reflection flips the sheet gives the common wrong answer +1+1, and using the line's slope gives −2-2): −1-1.
(d)A projection onto the line y=x\collapsedLine{y = x} squishes the unit square flat onto a line segment with no width: 00.
2

A linear map sends the green basis arrow to (4,1)\firstArrow{(4, 1)} and the pink basis arrow to (2,3)\secondArrow{(2, 3)}. Find the upright area, the flipped area, and the determinant of the map. What happens to the determinant if the two arrows swap landing spots?

Break each arrow into its right part and up part: which pair of perpendicular parts forms the upright rectangle, and which pair is crossed over?

Upright area (green-right times pink-up)
4×3\displaystyle \firstArrow{4} \times \secondArrow{3} =12\displaystyle = 12
(Watch out: multiplying the two parts of the same arrow, 4×1=4\firstArrow{4} \times \firstArrow{1} = 4 and 2×3=6\secondArrow{2} \times \secondArrow{3} = 6, pairs each arrow with itself instead of pairing the two arrows together.)
Flipped area (pink-right times green-up)
2×1\displaystyle \secondArrow{2} \times \firstArrow{1} =2\displaystyle = 2
DeterminantSubtract the flipped area from the upright area (adding the two pieces instead of subtracting gives the wrong answer 1414):
12−2\displaystyle 12 - 2 =10\displaystyle = 10
Swapping the two arrowsTrading the landing spots swaps the upright and flipped pieces (2−122 - 12), giving the same parallelogram flipped over with a determinant of −10-10.
3

A circle of area 9π9\pi is transformed by the matrix [1423]\begin{bmatrix} \firstArrow{1} & \secondArrow{4} \\ \firstArrow{2} & \secondArrow{3} \end{bmatrix} into a slanted ellipse. Find the determinant of the matrix, explain what its sign means, and find the geometric area of the ellipse.

Find the matrix's signed area scaling factor first, then separate what the minus sign and the number do to the circle's area 9π9\pi.

Determinant of the matrix
det⁡[1423]=(1×3)−(4×2)=3−8=−5\displaystyle \det \begin{bmatrix} \firstArrow{1} & \secondArrow{4} \\ \firstArrow{2} & \secondArrow{3} \end{bmatrix} = (\firstArrow{1} \times \secondArrow{3}) - (\secondArrow{4} \times \firstArrow{2}) = 3 - 8 = -5
Meaning of the signThe minus sign means the map flips the rubber sheet over to its back side, while the 55 means every area is multiplied by 55.
Geometric area of the ellipseMultiply the circle's area by the positive area scaling factor 55 (keeping the minus sign to get −45π-45\pi, or squaring the determinant to get 25×9π=225π25 \times 9\pi = 225\pi as if it were a length scale, are two common mistakes):
ellipse area\displaystyle \text{ellipse area} =5×9π\displaystyle = 5 \times 9\pi =45π\displaystyle = 45\pi
4

Find the area of the triangle with corners at (2,1)(2, 1), (6,2)(6, 2), and (4,5)(4, 5).

Pick (2,1)(2, 1) as your starting corner, find the arrows from it to the other two corners to slide the triangle to the origin, and relate the triangle to the parallelogram those two arrows frame.

Slide (2,1)(2, 1) to the originSubtract (2,1)(2, 1) from the other two corners to get the two side arrows (plugging the original coordinates (6,2)(6, 2) and (4,5)(4, 5) into the determinant without subtracting (2,1)(2, 1) first is a common mistake that gives 12(6×5−4×2)=11\frac{1}{2}(6 \times 5 - 4 \times 2) = 11):
green arrow=(6−2,  2−1)=(4,1)pink arrow=(4−2,  5−1)=(2,4)\displaystyle \begin{aligned} \firstArrow{\text{green arrow}} &= (6 - 2,\; 2 - 1) \\ &= \firstArrow{(4, 1)} \\ \secondArrow{\text{pink arrow}} &= (4 - 2,\; 5 - 1) \\ &= \secondArrow{(2, 4)} \end{aligned}
Parallelogram area
parallelogram area\displaystyle \text{parallelogram area} =(4×4)−(2×1)\displaystyle = (\firstArrow{4} \times \secondArrow{4}) - (\secondArrow{2} \times \firstArrow{1}) =16−2\displaystyle = 16 - 2 =14\displaystyle = 14
Triangle areaTake half of the parallelogram's area (stopping at 1414 forgets to cut the parallelogram in half along its diagonal):
triangle area\displaystyle \text{triangle area} =12×14\displaystyle = \frac{1}{2} \times 14 =7\displaystyle = 7
5

Map A\theMap{A} has matrix [3124]\begin{bmatrix} \firstArrow{3} & \secondArrow{1} \\ \firstArrow{2} & \secondArrow{4} \end{bmatrix}. Map B\theMap{B} stretches both basis arrows by a factor of 22 and then reflects the grid across a line. What is the determinant of applying A\theMap{A} followed by B\theMap{B}, and what does the combined map BA\theMap{B}\theMap{A} do to areas and orientation?

Find det⁡A\det \theMap{A} from its columns, then find det⁡B\det \theMap{B} by picturing what stretching both sides of the 1×11 \times 1 unit square by 22 and flipping the sheet does to its signed area.

Determinant of A\theMap{A}
det⁡A\displaystyle \det \theMap{A} =(3×4)−(1×2)\displaystyle = (\firstArrow{3} \times \secondArrow{4}) - (\secondArrow{1} \times \firstArrow{2}) =12−2\displaystyle = 12 - 2 =10\displaystyle = 10
Determinant of B\theMap{B}Stretching both basis arrows by 22 turns the 1×11 \times 1 unit square into a 2×22 \times 2 square of area 44, and reflecting across a line flips the sheet over, so det⁡B=−4\det \theMap{B} = -4 (using det⁡B=−2\det \theMap{B} = -2 forgets that stretching both width and height by 22 multiplies area by 2×2=42 \times 2 = 4, which leads to the wrong answer −20-20).
Combined map BA\theMap{B}\theMap{A}Multiply the two scaling factors:
det⁡(BA)\displaystyle \det(\theMap{B}\theMap{A}) =(det⁡B)(det⁡A)\displaystyle = (\det \theMap{B})(\det \theMap{A}) =(−4)×10\displaystyle = (-4) \times 10 =−40\displaystyle = -40
The combined map multiplies every area by 4040 and flips the sheet over, with determinant −40-40.
6

In 3D space, a linear map sends the first two basis arrows to (1,0,0)\firstArrow{(1, 0, 0)} and (0,2,0)\secondArrow{(0, 2, 0)}, and the third basis arrow to (0,0,−4)\thirdArrow{(0, 0, -4)}. What is the determinant of this map, what happens to the volume and handedness of a shape under it, and what happens to the determinant if the third arrow instead lands at (3,5,0)\thirdArrow{(3, 5, 0)}?

Picture the 1×1×11 \times 1 \times 1 unit cube stretched along the three axes, and notice which flat plane the first two arrows lie in.

When the third arrow lands at (0,0,−4)\thirdArrow{(0, 0, -4)}The unit cube is stretched into a 1×2×4\firstArrow{1} \times \secondArrow{2} \times \thirdArrow{4} box while the third arrow is pushed through the xyxy-plane of the first two arrows to −4\thirdArrow{-4}:
determinant\displaystyle \text{determinant} =1×2×(−4)\displaystyle = \firstArrow{1} \times \secondArrow{2} \times (\thirdArrow{-4}) =−8\displaystyle = -8
Every volume is multiplied by 88, and space flips from right-handed to left-handed (ignoring the sign to get +8+8 misses that the third arrow crossed through the plane of the other two).
When the third arrow lands at (3,5,0)\thirdArrow{(3, 5, 0)}Its third coordinate is 00, so all three arrows lie in the flat xyxy-plane (multiplying 1×2×3=6\firstArrow{1} \times \secondArrow{2} \times \thirdArrow{3} = 6 or 1×2×5=10\firstArrow{1} \times \secondArrow{2} \times \thirdArrow{5} = 10 misses that the third arrow has zero height out of the xyxy-plane), squishing 3D space flat to zero volume and giving a determinant of 00.
7

Let A=[2613]\theMap{A} = \begin{bmatrix} \firstArrow{2} & \secondArrow{6} \\ \firstArrow{1} & \secondArrow{3} \end{bmatrix}. Use the determinant to explain why A\theMap{A} has no inverse, and determine how many solutions Ax=b\theMap{A}\point{x} = \point{b} has when b=(4,2)\point{b} = \point{(4, 2)} versus when b=(4,1)\point{b} = \point{(4, 1)}.

Check where the two column arrows land on the grid, and see whether each target point b\point{b} sits on or off that collapsed line.

Why A\theMap{A} has no inverse
det⁡[2613]=(2×3)−(6×1)=6−6=0\displaystyle \det \begin{bmatrix} \firstArrow{2} & \secondArrow{6} \\ \firstArrow{1} & \secondArrow{3} \end{bmatrix} = (\firstArrow{2} \times \secondArrow{3}) - (\secondArrow{6} \times \firstArrow{1}) = 6 - 6 = 0
Because the determinant is 00, A\theMap{A} squishes the entire 2D grid onto the single line through (2,1)\firstArrow{(2, 1)} and (6,3)\secondArrow{(6, 3)} and cannot be run backward.
Number of solutions for each target point b\point{b}(assuming det⁡A=0\det \theMap{A} = 0 always means "no solutions" without checking whether b\point{b} sits on the collapsed line is a common mistake):
For b=(4,2)=2(2,1)\point{b} = \point{(4, 2)} = 2\firstArrow{(2, 1)}, the target point lies right on the collapsed line, so an entire line of starting points x\point{x} squishes onto it: infinitely many solutions.
For b=(4,1)\point{b} = \point{(4, 1)}, the target point sits off the collapsed line, so nothing ever lands there: no solutions.