Matthew van Eerde's web log

  • Matthew van Eerde's web log

    Generating a sine wave with phase - answers


    In a previous post I posed several mathematical problems... I'd like to go back and give some answers to them.

    To reiterate, we take a sine wave period and wrap it around a cylinder, giving us this:
    Sine wave wrapped around a cylinder

    The problems are to:

    1. Prove that the curve is planar.
    2. Prove that the curve is an ellipse.
    3. Make a Keplerian observation. Johannes Kepler was a mathematician/astronomer who made several observations relating to planetary orbits.

    Let's define the curve. Since we're going to be making analogies to planetary orbit, let's define the curve parametrically. The parametric point is the analog of a planet.

    Peter piper picked a peck of pickled peppers. -- Mother Goose

    Penny Pingleton, you know you are punished. From now on you're wearing a giant P on your blouse EVERY DAY to school so that the whole world knows that Penny Pingleton is permanently, positively, punished.
    -- Prudence Pingleton, Hairspray

    OK, now that we have that out of the way... I want the parametric point to sweep its way around the unit cylinder with constant angular velocity, as viewed from above. So if we project the path of the point into the unit cylinder with z = 0, then r(t) = 1 for all t and θ(t) is linear in t. In fact let's have θ(t) be t, so at time t = 2π our parametric point has made a complete cycle.

    Now we'll add the z component in. The curve is a wrapping of sin(t), so z = sin(t); we aren't affecting the vertical component of the paper by wrapping it horizontally around a cylinder.

    We're actually, in a sense, done. We have the formalized equations:

    • r(t) = 1
    • θ(t) = t
    • z(t) = sin(t)

    But let's convert to Cartesian coordinates, since we'll be dealing with planes. The relevant formulae are:

    • x2 + y2 = r2
    • tan(θ) = y/x

    A little intuition, checked by back-substitution, gives us these for x and y:

    • x(t) = cos(t)
    • y(t) = sin(t)

    Putting these together with our formula for z, we have:

    • x(t) = cos(t)
    • y(t) = sin(t)
    • z(t) = sin(t)

    Note that, no matter what t is, y(t) = z(t)... that is, the parametric point travels entirely in the plane given by the equation y = z. This proves that the parametric path is planar. QED #1.

    To tackle #2 we have to prove that this planar curve is, in fact, an ellipse. One way to do that would be to come up with x' and y' coordinates in the plane of the curve, transform the parametric equations into the new coordinate system, and verify that a(x')2 + b(y')2 = c2 for some a, b, and c... but when I came up with the problem I had a much simpler proof in mind. There's also a third way of doing this, where you note that the curve is the result of an affine transformation of the unit circle... and an affine transformation of a circle is demonstratably an ellipse... but I hadn't thought of that.

    Another astronomer/mathematician, Appollonius of Perga, made a study of "conic sections"... that is, the intersection of a plane with a double-headed cone. He came up with an exhaustive list of the kinds of curves that resulted.

    Basic conic sections:

    • Ellipse An ellipse, if the angle that the plane makes is shallower than the edge of the cone;
    • Hyperbola A hyperbola, if the angle that the plane makes is steeper than the edge of the cone;
    • Parabola And a parabola, if the plane is parallel to the edge of the cone.

    For complicated reasons (to wit, that gravity diminishes as the square of the distance between two objects,) all heavenly bodies trace either an ellipse or a hyperbola as they go around (or past) another heavenly body.
    Parabolae are theoretically possible but would smack heavily of "design"; as yet none have been observed.

    For completeness, there are other "designed" ways to intersect a double-headed cone with a plane in a coincidental fashion:

    Degenerate conic sections:

    • Circle A circle - early astronomers were convinced that the heavenly bodies moved only in circles. It took a long time for us to believe our measurements (which showed uncircular orbits) and acknowledge that the orbits are in fact elliptical. Instead, great efforts were made to show that the deviation could be made up of other, smaller, circular sub-orbits. Eventually we admitted that the orbits were elliptical (ellipses are more complicated than circles, but much simpler than the proposed circles-within-circles) and not until Newton did we understand why planets move in ellipses.
    • Straight Line A straight line - this is a degenerate hyperbola. This is one solution to the "one body" problem.
    • Two Straight Lines Two intersecting straight lines - a hyperbola, as seen from infinitely far off.
    • Single Point A single point - the other solution to the "one body" problem.

    Since our curve is the intersection of a plane and a cylinder, we're done! QED #2. Well, not quite.

    Appolonius' results hold for cones. We have a cylinder. Those aren't quite the same thing. Right?

    They aren't, quite... but a cylinder can be viewed as a degenerate form of cone. To wit, a cylinder is a cone whose apex is infinitely far off. I'll get back to a "proof" of this in a minute, but if you allow this, then we really are done.

    Instead of the seven intersections of a double-headed cone and a plane, there are only four ways a cylinder and a plane can intersect. Two of these are new.

    Cylindrical conics:

    • Ellipse in a Cylinder An ellipse - though it remains to be proven that this really is an ellipse. A circle is a special form of this... I won't show it again.
    • Straight Line in a Cylinder A straight line - the single body problem again.
    • Parallel Lines in a Cylinder Two straight lines - parallel this time. This is something new.
    • Empty Intersection with a Cylinder No intersection at all. The kōan of conics. This is new, but whether it is something is a question I will not attempt to address.

    Now for the proof that cylindrical intersection #1 really is an ellipse. Place two double-headed cones coaxially with the cylinder. Arrange them so that:

    • The apexes of both cones are in the "up" direction, from anywhere on the curve in question.
    • The "top" cone intersects the highest point on the curve in question.
    • The "bottom" cone intersects the lowest point on the curve in question.

    Auxiliary cones

    Notice that the entire curve lies in between the two cones. Consider the intersection of the plane that determines the curve with each of the cones. We know both of these are ellipses; we know that the intersection of the plane with the "upper" cone lies wholly outside our unknown curve; and we know that the intersection of the plane with the "inner" cone lies wholly inside our unknown curve.

    Auxiliary cones - cross section

    The final stage of the proof lies in pushing the apexes of both cones to infinity, which "squeezes" our unknown curve in between two known ellipses. Since the horizontal distance between the cones goes to zero as 23/2 / tan(θ), our unknown curve cannot help but be elliptical-ish... to any degree of precision... and it is, thus, an ellipse. QED #2.

    For the final problem, we must make a "Keplerian observation." The observation in question is that our parametric point, like the planets, sweeps out equal areas in equal times. What makes this interesting is that the parametric point does not move in the same way that a planet does... so it's a little odd that such a similar result should hold... but it does.

    Let's talk a little about Kepler's second law. A planet moves around the sun in an elliptical orbit. Fine. The sun lies at one of the foci of the ellipse. An imaginary line between the planet and the sun will sweep out area at a constant rate. That is to say, when the planet is far from the sun, that line will be long... and it will move correspondingly slowly. When the planet is near to the sun, that line will be short... and it will move correspondingly quickly.
    Planetary orbit

    Conversely, our parametric point sweeps around the origin at constant angular velocity. So this is trivially "equal areas in equal times". Right?

    Not quite. It's true that our parametric point appears to have constant angular velocity, if you project its path into the x-y plane... that is, if you view it from directly above, from a point on the z-axis.

    But that's a silly way to look at things. To get an idea of the point's actual motion, it's far more natural to view it from an axis orthogonal to the plane of motion. So let's put an observer (Aranea) directly above the point, and another observer (Nellie) in the more natural location.
    Aranea and Nellie

    From Aranea's point of view, the motion is a simple constant-speed trip around a circle. But Nellie sees the parametric point's true velocity. The parametric point's velocity has two components... a constant "clockwise" component in the x-y plane, and a variable orthogonal component going "up" or "down". This is maximized when the curve crosses the x-y plane, and minimized when the curve is topping or bottoming out. So Nellie sees this:
    Parametric point

    It seems hard to believe, given that the parametric point is speeding up and slowing down according to different rules... and the notion of "center" is different... but the fact is, the parametric point also sweeps out equal areas in equal times!

    To see this most easily, look at Aranea's point of view again. Have Aranea draw a grid on her picture of the system. She can count the area swept out in any given time by counting the number of squares.

    Now consider what those squares look like to Nellie. They're rectangles. But they're all of equal area. Aranea and Nellie can label the squares according to some naming scheme, and will agree that the same set of squares/rectangles were swept out... but this means, since the rectangles are of equal area, that even in Nellie's point of view, equal areas are swept out in equal times! QED #3.

  • Matthew van Eerde's web log

    Blown movie lines - The Matrix


    In the first Matrix movie there's a very interesting character called Cypher.  If you go along with the theory that the Matrix series is a rough retelling of the story of Christ, Cypher is the closest analog to Judas Iscariot, who is one of the earliest very-interesting-characters.

    Unfortunately I personally found that the actor kind of got in the way of the character sometimes.

    For example, in his scene with Neo, Cypher has this line

    The image translators work for the construct program - but there's way too much information to decode the Matrix.

    The actor delivers this line in such a way (the image translators work for the construct program) as to imply that there are these thingies called "image translators", and this other thingy called a "construct program".  Furthermore, these "image translator" thingies are currently in the employ of the "construct program".  The "construct program" is apparently a very nasty beast with close ties to the machine Gestapo.  Therefore, if we were so foolish as to attempt to recruit the talents of the "image translators", the "construct program" would find out, and then we'd be in big trouble.

    It follows then, as the night the day, that we are thrown on our own, limited, resources... and what with piloting the ship and arranging the menu and what-not, decoding the matrix (being a substantial task) is rather low on the priority list.


    This would be an interesting reading, filled with wonderful foreshadowings of the inevitable discovery of Zion by the machines, except for one thing.

    It is already firmly established that the "construct program" is the Holodeck-like-thing that the crew of the Nebuchadnezzar use to equip themselves with simulated equipment (and simulated skills) for use in the simulated reality of the Matrix. So the above reading is, of course, nonsense.  The correct implication of the line is:

    There are these thingies called "image translators."  We throw bits of code at them and they translate them into electrical stimuluses that our brain interprets as images.  They can handle such-and-such amount of code.

    The construct program is under our control, and we scale back the amount of code it generates to what our image translators can handle.  That is why when you enter the construct program you can "see" your residual self-image and whatnot.

    However, the Matrix is not under our control, so we can't scale the amount of code it generates.  It so happens that the Matrix generates an awful lot of code, which overpowers our image translators... which is why these monitors just show a bunch of greenish symbols instead of pretty girls with hair of various colors.

    A delivery that gets this across would be more like

    The image translators work - for the construct program - but there's way too much information to decode the Matrix.
Page 1 of 1 (2 items)

March, 2008