Definition of affine function |
f(x, y) = Ax + By + Cfor some coefficients A, B, C.
Level lines |
Ax + By + C = Dwhere D is some constant.
Consider the 2D affine function where C = 0, namely Ax + By. The level line of this function for D = 0 is
Ax + By = 0or equivalently
[A, B][x, y] = 0.Recall that when the dot product of two vectors is 0 the vectors are perpendicular to each other. Therefore [A, B] is perpendicular to [x, y]. Thus the level line Ax + By = 0 is the line through the origin perpendicular to [A, B]:
Figure 3.1 |
|
|
Now consider an arbitrary level line Ax + By = D of this function. Any two points (x1, y1) and (x2, y2) on this line must satisfy
Ax1 + By1 = D and Ax2 + By2 = D.Thus we have
A(x1 - x2) + B(y1 - y2) = 0, and thusThus the vector between any two points on this level line is perpendicular to [A, B]. So this level line Ax + By = D must also be a line perpendicular to [A, B].
[A, B][x1 - x2, y1 - y2] = 0.
Distance from level lines to the origin |
-Bx = Ay = 0.We solve for x and y to find the intersection,
[x, y] = [DA, DB] / (A2 + B2).Then using Pythagoras' Theorem, we take √(x2 + y2) to get the distance to the origin:
D / √(A2 + B2).
Figure 3.2 |
|
|
3D affine functions |
f(x, y, z) = Ax + By + Cz.
Just as in the 2D case, we can use the dot product to show that the level line Ax + By + Cz = 0 is the plane through the origin perpendicular to the vector [A, B, C]. In fact, using the same method as for the 2D case, we can show that every level line of the form Ax + By + Cz = D is perpendicular to the vector [A, B, C].
Finally, again applying the same method as for the 2D case, we can find that the perpendicular distance from a level line of a 3D affine function to the origin is given by
D / √(A2 + B2 + C2).