A2 · Lesson 23 · Inverse functions and atan2
Undoing a function, and the angle in the right quadrant
A point sits at , . What angle does it make with the positive horizontal axis? Type into a calculator and it says −53.1°, which points down and to the right. The point is plainly up and to the left. The calculator didn't make an arithmetic mistake. It answered a slightly different question.
Play
- Move x and y to place the point anywhere. The arrow runs from the origin to it.
- The strip shows two angles: , what a calculator gives, and atan2, the angle the arrow actually makes.
- Visit all four quadrants. In which ones do the two angles agree? Where they disagree, by how much?
Predict
Where does the point at , really point?
126.9°. The ratio is the same for and for , two points on opposite sides of the origin, and only sees the ratio, so it has to pick one: it always answers between −90° and 90°, on the right-hand side. For a point on the left you add 180°: −53.1° + 180° = 126.9°. atan2 does that for you, because it looks at the signs of x and y separately.
Name it
Inverse functions undo, within a range
The inverse of a function , written , undoes it: if , then . You already know several pairs:
| , for | |
To find a formula for , write and solve for . The graph of is the graph of reflected in the line , since every point becomes .
An inverse only exists where never repeats an output: if two inputs give the same output, the inverse can't know which one to return. gives 9 for both 3 and −3, so is defined to return the positive one. The inverse trig functions make the same kind of choice, a principal range:
| Function | Returns |
|---|---|
| (arcsin) | −90° to 90° |
| (arccos) | 0° to 180° |
| (arctan) | between −90° and 90° |
So , though 150° has the same sine. When you know the angle should be somewhere else, you fix it yourself: .
atan2. For the angle of a point , there's a function that uses both coordinates and always gets the quadrant right:
- if , ;
- if , add 180° to that (or subtract 180°, to stay between −180° and 180°);
- if , the angle is 90° or −90°, by the sign of .
Every programming language has it, usually as atan2(y, x) with first. You'll use it constantly: the phase of an AC voltage, the angle of a complex number and the direction of a field all come from atan2 of two components.
Worked example
Find the inverse of and check it.
Show the solution
- Solve for x. Write and solve:
- Write the inverse.
- Check. Each undoes the other.
Answer .
Worked example
What angle does the point make with the positive axis?
Show the solution
- Plain inverse tangent. which points up and to the right.
- Find the quadrant. The point is down and to the left, in the third quadrant.
- Fix it with atan2. or 225°, measured the long way round.
Answer the point makes an angle of −135° with the positive axis (or 225°, measured the long way round).
Worked example
A voltage gain in decibels is , where is the voltage ratio. Write the inverse, and find the ratio for 26 dB and the decibels for a ratio of 50.
Show the solution
- Invert. Divide by 20 and undo the logarithm with a power of ten:
- Ratio for 26 dB.
- Decibels for a ratio of 50.
- Check. A function and its inverse undo each other: gives back 50.
Answer the inverse is . 26 dB is a ratio of 20.0, and a ratio of 50 is 34.0 dB.
Check
What angle does the point make with the positive horizontal axis? Give it between −180° and 180°.
Check
. What is ?
Check
Find the inverse of , as a formula in .
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Check
An angle between 90° and 180° has a sine of 0.4. What is the angle?
Check
Which of these has an inverse over all the real numbers, with no range restriction?
Check
Two functions and their inverses.
(a)
A sensor puts out volts at °C. What temperature gives 1.8 V?
(b)
Gain in decibels is . What voltage ratio is 34 dB?
(c)
How many decibels is a voltage ratio of 3?
Check
Derive the inverse of .
Step 1
Set , multiply both sides by , and collect the terms on one side:
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
Solve for . That's .
Explain why
Why can't alone tell you the angle of a point, and what extra information fixes it?
Dividing y by x throws away the signs as a pair: and give the same ratio, though they point in opposite directions. only sees the ratio, so it returns the angle on the right-hand side, between −90° and 90°. Knowing the sign of x fixes it: if x is negative, the point is on the left and the true angle is 180° away. atan2 takes x and y separately so it can do this.
Practice
Keep practicing
9 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.