The Plotting Machine
Imagine we have a plotting machine that, if you supply it a valid equation in x
and y
, along with a sheet of A4 paper, it will plot the points satisfying that equation (along with some handy axes!).
The machine always treats the centre of the page as (0,0). Any point x
cm to the right and y
cm up from the origin (in landscape orientation) is assigned the coordinates (x, y).
Exercise 1
Sketch the image the machine would produce if you supplied it the equation x² + y² = 1
along with a fresh sheet of paper.
The Task
Now imagine you're given a new sheet of paper along with this task: Use the machine to plot a circle of the same size but with a centre that's 5 cm higher than in the first image.
You might have hoped to trick the machine into treating 5 cm up as (0,0), but you cannot. Even if you could, your coordinate axes would be in the wrong place!
Offsets (Simple)
You experiment with the machine and discover that supplying the equation (x, y) = (2, 3)
draws a visible dot at 2 cm right and 3 cm up from the centre. Further investigation shows that (x-2, y-3) = (0, 0)
achieves the same result. Even (y, x) = (3, 2)
does the same, as it’s just another way of writing multiple equations with a single solution.
You consider what equation would draw a point 10 cm higher on the page. It’s straightforward: (x, y) = (2, 13)
. Applying what you learned earlier you realise you could have alternatively supplied (x, y) = (2, 3 + 10)
or (x, y-10) = (2, 3)
.
Exercise 2
Sketch the image the machine would produce if you supplied the equation (x, 4) = (5, y)
along with the usual blank sheet.
Functions
You discover that functions can be expressed as (\x -> 2 * x)
, which doubles the input. Similarly, (\y -> 2 * y)
does the same. The notation (\x -> x³)
represents a function that cubes the input.
Applying a function to an expression is done with function expression
. For example, supplying the equation (\x -> x+4) y = x
plots the same thing as y+4 = x
.
Exercise 3
Sketch the image the machine would produce if you supplied the equation (\z -> z²) y = x
with another sheet of paper.
Explicit Equations
Explicit equations have the form y =
.
Inverse Functions
An inverse function f_inv
of a function f
satisfies the property that supplying y =
produces the same plot as
.
You find that the plot made from the equation (x,y) = (0,5)
is able to be shifted in two interesting ways:
One way is to simply shift the right hand side (RHS) directly by the amount you want to shift it: (x,y) = (\(a,b) -> (a,b) + (-1,1)) (0,5)
plots the same thing as (x,y) = (-1,6)
.
Another way is to shift the left hand side (LHS) by the opposite of what you you want to shift the result by (i.e. apply it's inverse function): (\(a,b) -> (a,b) - (-1,1)) (x,y) = (0,5)
plots the same thing as (x+1,y-1) = (0,5)
, which in turn is the same as plotting (x,y) = (-1,6)
.
Implicit Equations
Finally, after much experimentation, you find that the plotter can even handle equations that look like the following x² + y² = 4
which plots a circle of radius 2 in the centre of the plot.
You find you don't have a sqrt function of any kind available so when you tried to invert this function you got stuck. These equations are called "Implicit".
Offsets (General)
You want to shift the circle but notice that you can't just apply the direction function to the "RHS of the explicit equation" because there is no explicit form. What you find you CAN do however is pre-apply the inverse function to the equation as a whole and that still works