Here's an ellipse for you.[br][br]Play with the focus A. (Its twin moves automatically.)[br]These two foci belong to a whole bunch of ellipses, but point B selects just one of them.[br][br]Play with point B.[br]The line through B and the ellipse's center splits the ellipse in half. The slider flips one of those halves.[br][br]Play with the slider.
Motivated by [url=https://twitter.com/howie_hua/status/1777093460971200780?t=T4oJCnpxYLp7JQ-Y4yhD4g&s=19]Howie Hua[/url].
I often use GeoGebra to build interactive visual demonstrations of mathematical ideas. The mathematics required to [i]make[/i] one of these gadgets is usually more complicated than the mathematics being [i]demonstrated[/i], and that's certainly the case here.[br][br]I'm not even sure I had a mathematical demonstration in mind, beyond the ideas that[br][list=1][*] An ellipse is a curve that is a little bit like a circle, and its construction has something to do with "foci";[/*][*] If you cut an ellipse the right way and flip one half over, you sometimes get a heart (the icon, not the organ--wouldn't THAT be neat!).[/*][/list][br]But what mathematics went into the production?[br][br]The main technical challenge is that GeoGebra (at least version 5.0, which I'm using) doesn't have a command to make a filled half-ellipse. A filled half-ellipse is something people very rarely need, but I absolutely needed one if I was to build this toy.[br][br]What GeoGebra [i]does[/i] have is a few tools for making parts of [i]circles[/i]. (Apparently I really like [i]italics[/i] today.)[br]It can also apply a matrix transformation to many shapes.[br][br]So, I did about a page of algebra by hand in order to compute the matrices of a few linear transformations to do the following:[br][list=1][*]Given the foci of an ellipse centered at the origin, transform that ellipse into the unit circle centered at the origin. (Also see where a given point on that ellipse goes, so I can relate any half of the ellipse to the corresponding half of the circle.)[/*][*]Given half of the unit circle, transform it back to fill the corresponding half of the original ellipse.[/*][*]Repeat #2, but include a parameter (controlled by the slider) in order to smoothly transition from exactly #2 to a version of #2 that is reflected across a line perpendicular to the indicated line.[/*][/list][br]It's been a minute since I last worked with ellipses. There might be a nifty shortcut that I've forgotten or never knew, but what I used was the idea that an ellipse is the set of all points whose total distance from the two foci is a given constant.[br][br]My algebraic work was maybe 70% chewing on the distance formula (not "autopilot algebra", but not at all difficult after I recovered from one wrong turn, and there were more serendipitous cancellations than I'd expected) and 30% matrix algebra (this part was made a little easier by knowing the shortcut for inverting a 2x2 matrix, and a [i]lot[/i] easier by thinking in terms of a change of basis).[br][br][b]I think this is a project that a student could do by the end of a first course in linear algebra.[/b][br][br][br][br]The technical subtlety that gave me the best tickle was the fade effect. I have two overlapping filled half-ellipses. Both are visible before one of them gets flipped, but the stationary one fades out of view by the end of the flip. I want their combined opacity to match an unaltered half-ellipse at the start and end of the flip. I won't tell you how I did this, but you can take a look for yourself. If you want to look under the hood, here's what you do:[br][list=1][*] Open a desktop installation of GeoGebra.[/*][*] Download my applet (or any GeoGebra applet, for that matter) from the Details screen (off the drop-down menu from the three dots in the top right corner, I think).[/*][*] Open the downloaded .ggb file in GeoGebra.[/*][*] Explore however you like, but I especially recommend that you use the Construction Protocol view to see the parts in the order in which they were built.[br][/*][/list][br][br]I'd like to close with a special thanks to Bonnie Tyler, without whom none of this would have happened. If you don't know what I'm talking about...please. The source material is from 1982. The song, aptly described by its composer as "[url=https://en.wikipedia.org/wiki/Total_Eclipse_of_the_Heart]an onslaught of sound and emotion[/url]", also has a music video that reaches epic levels of WHAT.[br]