A223 of 29
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

A2 · Lesson 23 · Inverse functions and atan2

Undoing a function, and the angle in the right quadrant

A point sits at x=−3, y=4. What angle does it make with the positive horizontal axis? Type tan−1⁡(4/−3) 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: tan−1⁡(y/x), 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 x=−3, y=4 really point?

Name it

Inverse functions undo, within a range

The inverse of a function f, written f−1, undoes it: if f(a)=b, then f−1(b)=a. You already know several pairs:

ff−1
10xlog10⁡x
exln⁡x
x2, for x≥0x
2x−6(x+6)/2

To find a formula for f−1, write y=f(x) and solve for x. The graph of f−1 is the graph of f reflected in the line y=x, since every point (a,b) becomes (b,a).

An inverse only exists where f never repeats an output: if two inputs give the same output, the inverse can't know which one to return. x2 gives 9 for both 3 and −3, so 9 is defined to return the positive one. The inverse trig functions make the same kind of choice, a principal range:

FunctionReturns
sin−1⁡x (arcsin)−90° to 90°
cos−1⁡x (arccos)0° to 180°
tan−1⁡x (arctan)between −90° and 90°

So sin−1⁡(0.5)=30°, though 150° has the same sine. When you know the angle should be somewhere else, you fix it yourself: 180°−30°=150°.

atan2. For the angle of a point (x,y), there's a function that uses both coordinates and always gets the quadrant right:

  • if x>0, atan2(y,x)=tan−1⁡(y/x);
  • if x<0, add 180° to that (or subtract 180°, to stay between −180° and 180°);
  • if x=0, the angle is 90° or −90°, by the sign of y.

Every programming language has it, usually as atan2(y, x) with y 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 f(x)=3x−4 and check it.

Show the solution
  1. Solve for x. Write y=3x−4 and solve: x=y+43
  2. Write the inverse. f−1(x)=x+43
  3. Check. f−1(5)=3f(3)=9−4=5 Each undoes the other.

Answer f−1(x)=x+43.

Worked example

What angle does the point (−3,−3) make with the positive x axis?

Show the solution
  1. Plain inverse tangent. tan−1⁡(−3/−3)=tan−1⁡(1)=45° which points up and to the right.
  2. Find the quadrant. The point is down and to the left, in the third quadrant.
  3. Fix it with atan2. 45°−180°=−135° or 225°, measured the long way round.

Answer the point makes an angle of −135° with the positive x axis (or 225°, measured the long way round).

Worked example

A voltage gain in decibels is G=20log10⁡r, where r 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
  1. Invert. Divide by 20 and undo the logarithm with a power of ten: r=10G/20
  2. Ratio for 26 dB. r=101.3=20.0
  3. Decibels for a ratio of 50. G=20log10⁡50=34.0dB
  4. Check. A function and its inverse undo each other: 1034.0/20 gives back 50.

Answer the inverse is r=10G/20. 26 dB is a ratio of 20.0, and a ratio of 50 is 34.0 dB.

Check

What angle does the point (−4,−4) make with the positive horizontal axis? Give it between −180° and 180°.

Check

f(x)=3x+1. What is f−1(30)?

Check

Find the inverse of f(x)=2x−6, as a formula in x.

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 V=0.4+0.01T volts at T °C. What temperature gives 1.8 V?

(b)

Gain in decibels is G=20log10⁡r. What voltage ratio is 34 dB?

(c)

How many decibels is a voltage ratio of 3?

Check

Derive the inverse of f(x)=ax+bcx+d.

Step 1

Set y=f(x), multiply both sides by cx+d, and collect the x terms on one side: x(cy−a)=?

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°.

Explain why

Why can't tan−1⁡(y/x) alone tell you the angle of a point, and what extra information fixes it?

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.