{"id":102,"date":"2015-04-04T11:47:32","date_gmt":"2015-04-04T15:47:32","guid":{"rendered":"http:\/\/aelservices.ca\/?p=102"},"modified":"2015-04-04T11:47:32","modified_gmt":"2015-04-04T15:47:32","slug":"simple-sine-wave-interference","status":"publish","type":"post","link":"https:\/\/aelservices.ca\/?p=102","title":{"rendered":"Simple Sine Wave Interference"},"content":{"rendered":"<p>A Python project I did while bored one day.<\/p>\n<p>The original intent was to have the output be the final animated gif file, but I never finished that aspect and just used <a title=\"Gnu Image Manipulation Program\" href=\"http:\/\/www.gimp.org\/\" target=\"_blank\">GIMP<\/a>\u00a0to compile the stills.<\/p>\n<p>The idea was just to have sine waves that emanated from given points and be able to accurately display the waves and in the case of multiple origins, the interference patterns.<\/p>\n<p>Just think of them as being seen from above, white being crests and black being troughs. \u00a0Now, this was around the same time as the Voronoi images so no surprise that different metrics where on my mind. \u00a0I did the normal Euclidean distance but also threw in my favourite alternate metric, Manhattan distance.<\/p>\n<p>So, some typical examples follow. \u00a0These are the same sine\u00a0waves, same amplitude, frequency and velocity, just different metrics.<\/p>\n\n<table id=\"tablepress-5\" class=\"tablepress tablepress-id-5\">\n<tbody>\n<tr class=\"row-1\">\n\t<td class=\"column-1\">Single origin, Euclidean distance sine wave.  No drop off of amplitude here or in any of the animations shown below, although the software was capable of it.  Basically you have expanding concentric circles here, nothing mind blowing.<\/td><td class=\"column-2\"><a href=\"http:\/\/aelservices.ca\/wp-content\/uploads\/2015\/04\/Untitled1.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/aelservices.ca\/wp-content\/uploads\/2015\/04\/Untitled1.gif\" alt=\"Single origin, Euclidean distance sine wave.\" width=\"320\" height=\"240\" class=\"size-full wp-image-107\" \/><\/a><\/td>\n<\/tr>\n<tr class=\"row-2\">\n\t<td class=\"column-1\">Single origin, Manhattan distance sine wave.  This is the same origin point, same frequency, amplitude and velocity, only the distance metric changes.  Expanding concentric diamonds (or squares if you don't think standing a square on a point changes anything about it) replace the circles, but of the same thickness etc.  A little neat, but nothing to write home about.<\/td><td class=\"column-2\"><a href=\"http:\/\/aelservices.ca\/wp-content\/uploads\/2015\/04\/Untitled2.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/aelservices.ca\/wp-content\/uploads\/2015\/04\/Untitled2.gif\" alt=\"Single origin Manhattan distance sine wave\" width=\"320\" height=\"240\" class=\"size-full wp-image-108\" \/><\/a><\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">Dual origin, Euclidean distance sine waves, interfering.  The two wave generators are producing waves of identical frequency, amplitude and velocity.  A nice interference pattern looking exactly as one would expect.<\/td><td class=\"column-2\"><a href=\"http:\/\/aelservices.ca\/wp-content\/uploads\/2015\/04\/Untitled3.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/aelservices.ca\/wp-content\/uploads\/2015\/04\/Untitled3.gif\" alt=\"Dual origin, Manhattan distance sine waves interfering\" width=\"320\" height=\"240\" class=\"size-full wp-image-109\" \/><\/a><\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">Dual origin, Manhattan distance sine waves, interfering.  So, this has the same origin points, same frequency, amplitude and velocity as the one just above, but Manhattan distance is used instead of the normal Euclidean distance.  This is the exact same interference pattern as the one just above, but because of how the distance is calculated, we get this really neat patchwork effect.  I discuss just a few of the key features after the cut.<\/td><td class=\"column-2\"><a href=\"http:\/\/aelservices.ca\/wp-content\/uploads\/2015\/04\/Untitled4.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/aelservices.ca\/wp-content\/uploads\/2015\/04\/Untitled4.gif\" alt=\"Dual origin, Manhattan distance sine waves interfering\" width=\"320\" height=\"240\" class=\"size-full wp-image-110\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-5 from cache -->\n<p><!--more--><\/p>\n<p>So, there are nine rectangles in that last image. \u00a0Look at the centre one and compare it to the same region on the Euclidean distance version just above it. \u00a0The upper right and lower left corners of that middle rectangle are the origin points of our waves.<\/p>\n<p>So, consider the upper right corner of that centre rectangle. \u00a0A horizontal line through that point right across the image and also a vertical line through that point divide the image into locale regions of behaviour.<\/p>\n<p>We have the grey, never too dark never too light diagonal line group extending off to the upper right. \u00a0Also a checkerboard pattern of squares with fuzzy edges extending away to the lower right and upper left of that point. \u00a0Finally, as far as that point is concerned, we see the rectangle with the two wave origin points describing two opposite corners has an\u00a0interference pattern of diagonal lines between which are a set of linear standing waves.<\/p>\n<p>There are also the upper left and lower right regions, which have no edges that touch a wave origin point. \u00a0Neat features there to notice are how the dark bands and light bands match with the checkerboard regions. \u00a0Thinking about the math here it&#8217;s not surprising. \u00a0In fact none of the behaviour of this image is surprising after looking at it and thinking about it for a bit. \u00a0In advance though, I had no idea what to expect.<\/p>\n<p>I first produced still images, and found them intriguing\u00a0enough to make\u00a0a first\u00a0animation. \u00a0Looking at it at first I found it neat and strange. \u00a0Thinking about it for a bit it started to make a lot of sense. \u00a0I was able to notice all sorts of features, including many that I haven&#8217;t mentioned above at all. \u00a0A simple change and suddenly I could look back at the standard circular interference patterns above and see those had corresponding regions, but they didn&#8217;t jump out visually like they do here. \u00a0You can now look back at the circular versions above and notice that yes, there are sub-regions of behaviour that do map up, but they transition so slowly you probably missed them before.<\/p>\n<p>I was just playing around when I made these, but I ended up learning a bit more about waves as a result. \u00a0It shows how math is like drawing or painting. \u00a0Sometimes when you draw or paint you should rotate your canvas 90 degrees then look at it. \u00a0Little mistakes or areas that need attention suddenly jump out from this changed perspective. \u00a0You end up with a far better final work for having taken just those few minutes to change your perspective. \u00a0It&#8217;s true in art, in math, and just in life in general.<\/p>\n<p>There, you even got a greeting card sentiment at the end.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A Python project I did while bored one day. The original intent was to have the output be the final animated gif file, but I never finished that aspect and just used GIMP\u00a0to compile the stills. The idea was just to have sine waves that emanated from given points and be able to accurately display [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[10],"tags":[13,14,7,4],"class_list":["post-102","post","type-post","status-publish","format-standard","hentry","category-general-mathematics","tag-distance-metrics","tag-gimp","tag-mathematics","tag-python"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5UQlH-1E","_links":{"self":[{"href":"https:\/\/aelservices.ca\/index.php?rest_route=\/wp\/v2\/posts\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aelservices.ca\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aelservices.ca\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aelservices.ca\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aelservices.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=102"}],"version-history":[{"count":6,"href":"https:\/\/aelservices.ca\/index.php?rest_route=\/wp\/v2\/posts\/102\/revisions"}],"predecessor-version":[{"id":117,"href":"https:\/\/aelservices.ca\/index.php?rest_route=\/wp\/v2\/posts\/102\/revisions\/117"}],"wp:attachment":[{"href":"https:\/\/aelservices.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aelservices.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aelservices.ca\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}