However, these are just side-effects of the actual difference between the two. The fundamental difference between breads and cakes lie in two aspects:
To elaborate, cakes have fat, namely butter or shortening, while bread has none. Fat is what makes cakes “creamy” and “smooth” compared to breads. Since fat doesn’t really bind with water (i.e. the batter), we’ll need something to bind the fat to the batter or else it’ll just evaporate when you bake it, thus the need for egg whites. Breads don’t have fat so it doesn’t need egg whites to bind the fat to the batter.
Rising agents are substances that release gases due to some reaction. They make breads and cakes fluffy and without them, we’ll get breads and cakes that are as compact as bricks. The riser used in cake is baking powder which is similar to baking soda except that it reacts with water instead of acids (e.g. vinegar) to release carbon dioxide. Breads on the other hand, use yeast which reacts with starch to produce carbon dioxide and gluten, an adhesive substance that holds the bread together, making it rougher and harder than cakes.
There are two particular variations of this pattern: dinner rolls and (American) biscuits^{1}. Dinner rolls are basically breads with fats. Biscuits, are a bit more interesting. They are cakes without eggs and eggs are rich in proteins which are binding substances. Because of the lack of eggs, biscuits are less sturdy than cakes and breads, crumbling more easily.
In our country, biscuits are synonymous to crackers or cookies. Though what I’m referring to here are the things that are similar to scones.↩
Using the tools from projective geometry, particularly homogenous coordinates (as in the previous post), the line intersection and all the additional checks are elegantly handled by a single operation. Basically, let line a point is the intersection of two lines if and only if
where x, y, and w are not all zeroes. One way is to directly solve for this system, the other way is to simply
Solving for the determinant yields:
then simply equate x, y and z to the coefficients of respectively. In other words:
If w is zero, then the lines are parallel and x, y gives the normal of the lines. Else, if w is non-zero, then the lines intersect at x/w, y/w.
Note the following:
Appending to the matrix and setting its determinant to zero means that “if R is linearly dependent on either of the two previous rows, then this equation must be satisfied”. This means that ANY vector that is a linear combination of will satisfy the equation. This is convenient for us because this means that the coefficients of the resulting equation is orthogonal to the coordinates of both lines… which is exactly what were looking for!
x, y and w are, of course, in homogenous coordinates, so if the lines are parallel, they “intersect” at a “point at infinity”, represented by a point whose w = 0, which is basically the normal of the line. Note that this also works if you try to intersect a line at infinity with a normal line. If your application uses homogenous coordinates, you don’t really need to mind this (OpenGL already uses homogenous coordinates in drawing). However, if you need to do additional calculations in euclidean space (like for physics simlatuions), you may need to perform the said checks to the w (you’ll get a division by error if you just divide blindly).
We just saw how using homogenous coordinates made calculation of line intersections straightforward and mechanical (good for the processor). In total, it has 6 multiplies, 3 subtractions and optionally two divisions.
]]>This form is another way to extend the slope-intercept form. Instead of having a single “slope”, we split its numerator and denominator to different variables, $a, b$. Just by doing this, the form can represent vertical lines that the slope-intercept form cannot (set ). The reason why this is called implicit is that instead of having y “pop out” of the equation, we pop it back in so instead of having y = f(x), we have f(x,y) = 0.
By far, this is the most compact form of line representation, requiring only 3 numbers for storage. The vector〈a, b〉formed by coefficients of the equation is the “normal” of the line, the direction that is perpendicular to the direction of the line. Moreover, the direction is pointing to the “left” of the line. To illustrate, suppose we have the following equation:
The normal of the line is 〈 1,1 〉. Both line and normal look like the one below:
If we turn the equation to the normal will be 〈-1, -1〉which is still the same line but the normal will be facing the other way around.Actually, for any number s ≠ 0, equation will represent the same thing. Thus, the representation of the line is not unique. If you want to compare if two representations are the same, you’ll have to check if one is a multiple of the other (a mere equality test won’t work).
Another thing to note about this form is that linear implicit equations are “well-behaved”. By that, I mean that whenever is close to zero, you can be assured that somewhere near is the solution to f(x,y) = 0. This is how some anti-aliased software line renderers work. They evaluate k = f(x,y) at a point. If k is below an upper threshold, they start applying grayscale tint to that point, if k is below an even lower threshold, the point is assumed to be exactly in the line and color it black.
As a segway into the next line representation, what do you think will happen if we set a = b = 0 but c ≠ 0?
This form is very similar to the implicit form except with an additional coefficient, w, of the point (not of the line). Thus, the storage requirements for this representation is still 3 numbers. A shorthand of writing this representation of the line is [a, b, c]. The basis for this representation lies in the theory of projective geometries.
The central concept in projective geometry is the line-point duality: that what ever holds true for lines should also hold true for points. In particular, we know that in the euclidean geometry, there’s exactly one line passing through two distinct points. However, dual is not true since two lines does not always intersect at a point because if the two lines are parallel, it’s either they don’t intersect or they coincide, in which case, there are infinitely many points.
In order to make eculidean geometry projective, we include the notion of “points at infinity”. To visualize this, imagine you’re on a railroad track that extends to the horizon. Even if you very well know that the two rails of the track are parallel, at the horizon (which is very far away), they seem to intersect at a point. Moreover, if you rotate around and find another set of tracks, you’ll find that they intersect at a point distict from the previous one. This means that there is more than on point at infinity. Moreover, the line that contains all the points at infinity (the horizon in our example), is called the “line at infinity”.
They way to represent a projective n-dimensional eucledian geometry is to add another coordinate to it. We call this homogenous coordinates since we’ll be representing normal points and points at infinity in the same way (and makes certain calculations more uniform). So, in the case of 2D, we have 3 coordinates: x, y and w and in 3D, four coordinates: x, y, z and w. So how does it work?
First, to determine whether a point〈x, y, w〉is in the line [a, b, c], we have to check if ax + by + cw is 0. This is basically the inner product of the vectors [a, b, c] and [x, y, w]. For example, the point 〈1,1,1〉 is in the line [1, -1, 0] because 1(1) - 1(1) + 0(1) = 1 - 1 = 0.
Next in the implicit form, remember that if are the coefficients of the line, for any s ≠ 0, ((sax + sby + sc = s0 = 0$$ represents the same line. The same goes for points: for any s ≠ 0,〈sx, xy, sw〉represents the same point as〈x, y, w〉^{1}. Similarly, [sa, sb, sc] represents the same line as [a, b, c].
As a definition, the point〈x,y,w〉 is a point at infinity if w = 0. Otherwise, it is a normal point. Observe that the only line [a,b,c] that satisfies the equation 〈ax + by + c(0) = 0〉 for every x and y is [0,0,c] where c ≠ 0. This is called the line at infinity (to answer the question I posted in the previous section).
To convert a point 〈x,y〉 from eucledian space to the projective euclidean space, simply assume w = 1, 〈x,y,1〉. This also makes our line representation in homogenous coordinates exactly the same as in implicit form. To convert a point 〈x,y,w〉 into normal euclidean space, we “normalize” the form into 〈x/w, y/w, 1〉 so that we’ll get a “1” in the last component (note that you can’t do this if the point is at infinity) then extract the first and second component.
If you need any clarifications, post them in the comments below. I’ve just started blogging about math it may take me some time to figure out how to properly organizing my thoughts.
In linear algebra parlance, a point in projective geometry is represented by a one-dimensional vector space.↩
This is what is often taught in highschool. One important detail to this representation that is often skipped is that this is a scalar function which is why it is often written as . This makes analysis simple (straight integration and differentiation works). Moreover, in the case of a line, the function is a bijection which means that you can easily get the inverse.
The form requires only two numbers for storage: the slope and y-intercept . However, the problem with this form is that this cannot represent vertical lines (i.e. for some constant ). Moreover, it can only represent lines going in one direction: from left to right. While this might not seem so much of a big deal some geometric algorithms need a notion of line direction or “line sides” (i.e. positioned rays). You actually see the issue of “line sides” when you get exercises that requires you to graph or . You’ll end up shading the “top” or “left” of the line with the first inequality and the “bottom” or “right” with the second. However, you’ll notice that if you want to represent this, you’ll end up having to store an additional piece of information: the inequality.
Another form taught in highschool is using two points to represent a line. While a line contains infinitely many points, only two points are required to fully determine a line. The nice thing about this is that it can actually represent any line in the Euclidean plane, even vertical lines. Just set for some constant and set . The non-equality restriction is to prevent collapsing the line into a singularity.
This form requires 4 numbers for storage. While you can choose any two points in a line, it is recommended that you choose two points which are not too far and not too near to each other and both close to 0 to prevent numerical instabilities in computation.
As a bonus, if you take the ordering of points into consideration, you can use it to represent lines with directions by just changing their order. For example, a line going left to right could be represented by while a line going from right to left could be represented by . Moreover, this form can also represent line segments whose endpoints are the two specified points.
The problem with this representation is that this is hard to directly work with; you don’t have an actual equation that describes the relationship of the two points. More often than not, you’ll be converting this to other representations to do calculations.
This is basically an extension of the slope-intercept form. Instead of directly placing in the function , we turn into a function, say where , and change to be also dependent on . The second form of the parametric equation is the same thing but written in vector notation.
Like the two-point form, this also requires 4 numbers for storage. is the “starting point” of the line and is the direction the line is heading. For lines, can be any point in the line and can be of any magnitude. Also, like the two-point form, this form describes the direction of the line, e.g. describes a vertical line going up while describes a vertical line going down.
If we implement some restrictions, particularly on , this form can be used to represent positioned rays and line segments.
There are two more forms that I’m gonna tackle in the next article.
]]>