Graphics Reference
In-Depth Information
More generally, if
f : C
D
(7.11)
is an injective and surjective (or bijective ) function, its inverse,
(a)
f 1 : D
C ,
(7.12)
is the unique function satisfying
f 1 ( f ( x )) = x ,
for all x
D , and
(7.13)
f ( f 1 ( y )) = y ,
for all y
C .
(7.14)
(b)
Figure 7.1 illustrates these three classes of functions.
Inline Exercise 7.1: Which of the following functions have inverses? Describe
the inverses when they exist.
(a) The negation function N : R
R : x
→−
x .
(b) q 1 : R R : x
arctan( x ) .
(c)
(c) q 2 : R
[
−π/
2,
π/
2 ]: x
arctan( x ) .
Figure 7.1: Three different func-
tions: (a) is surjective but not
injective; (b) is injective but not
surjective; and (c) is bijective.
In describing functions, we'll always describe the domain, the codomain, and
the rule that associates elements in the first to elements in the second. Sometimes
these rules may involve cases, as in
1
1
x
1
u : R
R : x
,
(7.15)
0
otherwise
just as the code for a function may involve an if statement. We will also always
speak of functions by name (e.g., “the function f is continuous”) rather than saying
“the function f ( x ) is continuous,” because f ( x ) denotes the value of the function
at a point x ; this value is usually not a function. If we need to include the vari-
able name for some reason, we will write “the function x
f ( x ) is continuous at
x = 0, but not elsewhere,” for instance. This careful distinction becomes impor-
tant when we discuss functions like the Fourier transform, F , which operate on
functions, producing other functions. If we speak of “the function f
F ( f ) ,” we
are referring to the Fourier transform F ; if we speak of “the function F ( f ) ,” we
are referring to its value on a particular function f .
7.4.1 Inverse Tangent Functions
Mathematicians tend to define arctan, the inverse tangent function, from R to the
open interval (
tan 1 ( u ) .
−π/
2,
π/
2 ) . We'll sometimes use this, and denote it u
( x, y )
A frequent use of the inverse tangent is to find the angle,
, in the situation shown
in Figure 7.2: We have the point with coordinates ( x , y ) and want to know
θ
θ
.The
>
0, it's tan 1 ( y
/
x ) , followed by several special
usual answer is that when x
y
cases for when x <
0, y = 0, etc. These special cases have
been built into a single function, atan2, which takes a pair of arguments, rather
than a single one. It's almost always used in the form
0, y >
0, or x <
u
x
= atan2 ( y , x ) , which does
exactly what you would expect: It returns the angle between the x -axis and the ray
from ( 0, 0 ) to ( x , y ) . The returned angle is between
θ
Figure 7.2: How is θ related to x
and y?
−π
and
π
. In the case where x
 
 
 
Search WWH ::




Custom Search