Friday, 28 June 2019

Penrose tiles - Deflation


What are Penrose Tiles?

I first came across Penrose tiles in Martin Gardner's "Mathematical Games" column in Scientific American in 1977. They were invented shortly before that by Professor Roger Penrose who was a brilliant British mathematician and cosmologist. Among many other things he "revolutionised the mathematical tools that we use to analyse the properties of spacetime".

There are two types of tiles: a kite and a dart:
A kite and dart on the left                                       An ace or fool's kite on the right.
They are constructed from a rhombus (equal sided parallelogram) with the angles 72° and 144°. From this it follows that they fit together as an ace, as shown on the right. It also follows that each can tile round a vertex because 5 x 72 = 360.

There are four other ways to tile kites and darts round a vertex without coming unstuck.

You can also see from the cut rhombus that the lengths of the sides as either Short or Long. It turns our that the ratio of the long side to the short side is the golden ration known as ##\phi = 1.61803...## (phi) to the ancient Greeks. They would have written it$$\phi=\frac{\left(1+\sqrt5\right)}{2}$$They probably got it from considering a rectangle that contained another rectangle inside it with the same aspect ratio. The smaller rectangle is drawn with a dashed line and the equation for  ##\phi## follows directly:
From the ratio of the sides of Penrose tiles it is easy to prove the the ratio of the areas of a kite to a dart is also ##\phi##.

My adventures with Penrose tiles.

Back in 1977, computers were a rarity and the best way to play with Penrose tiles was to cut out bits of paper and arrange them on a table. But the corners curled up, the slightest breath of wind would misalign them and any pattern would soon go wonky. I had some paper tiles in a tin for a long time and imagined  having a computer program where I could really keep them neat and tidy. I never really studied deflation. I have now. PowerPoint came along in 1987 and in 1990 I met Microsoft Windows for the first time. In those days it used to crash about once every ten minutes. I was writing graphics programs for the beast. PowerPoint 7.0 in 1995 had VBA programming. I caught on to that in 2019 and realised a month ago that it would be handy for drawing Penrose tiles. It is very. All the above pictures and the movie are done with VBA in PowerPoint (screen capture by Debut). The biggest tiling so far is that one at the end of the movie: a whopping 13,854 kites, 8,669 darts - 22,523 tiles in total. That's very near the limit. These big tilings are produced by deflation which was also discovered by the great professor Penrose back in ~1974 about 45 years ago.

More to come - watch this space!

Wednesday, 19 June 2019

Penrose tiles

6th generation deflated sun pattern
This is a Penrose kite and dart tiling (P2) deflated six generations from a sun pattern. Work in progress. 
Sun

More coming soon!

Monday, 3 June 2019

Windows Defender and Google Drive

Windows Defender and Google Drive (Backup and Sync) seem to be incompatible. When you get a new Windows computer Windows Defender is preinstalled. If you then install Google Backup and Sync it copies all the your Google Drive data onto the new computer but after that synchronisation does not work. You may not notice this! You will notice that there is a Windows Defender pop up menu in File Explorer, but no Google Drive pop up menu. New files and folders that you create in your Google Drive folder are not created in your Google cloud. Updates and deletions are not propagated.

I do not know why this is. Perhaps it's because Microsoft want you to use OneDrive which is their version of Google Drive.

The solution

The solution is very simple: Replace Windows Defender by Avira which is highly recommended free anti-virus software.  (Other anti-virus software may also work).

1. Stop Google Backup and Sync(see below under Read more)
2. Disable Windows Defender in Windows settings. Their are good instructions here.
3. Install Avira.
4. Restart Google Backup and Sync(see below under Read more)
Google Backup and Sync then resyncs your data (which might take a while) and the useful file / folder icons and the Google Drive pop up menu reappear in File Explorer.

I am not even sure that steps 1 and 4 are necessary.

I could not find this very important information about Google Drive and Windows Defender anywhere on the web nor did Google Drive email help (googleone-support@google.com) seem to be aware of it. Many solutions, including those from Google help, suggest deleting all the files in your Google drive folder(s), reinstalling Drive and resyncing from the web. This would be a huge waste of time. Google help suggested doing that twice!

https://windowsreport.com/google-drive-wont-sync-windows-10/ claims to answer the question: "How to fix broken sync with Google Drive in Windows 10". It gives seven solutions. The first suggests reinstalling Google Drive and recopying all your data. That might take days and why would it work at the end? The second invites you to turn off virus protection! Very stupid. Solution 3 is "Install the previous version of Google Drive". Why would that work? The drivel continues.

I was so pleased with Avira (I have used the free version before) that I decided to buy it. It seemed to be 9.95€ which was very fair. But then it turned out to be 9.95€ per month. I cancelled the subscription and will continue with the free version.

Friday, 31 May 2019

When is a point inside a quadrilateral?

This all started because I am playing with four sided tiles (quadrilaterals) and needed to know if a point is inside one of the quadrilaterals. There are two basic shapes: kites and darts which you can see below. I got the (incorrect) answer, but not the proof, by searching on that web. There are other solutions which might be more reliable, but this one is good enough for my needs. There are some videos at the bottom of the post.

Kites

First we look at kites, quadrilaterals all of whose internal angles are less than 180°.

We show three situations with a point P inside (middle) or outside a kite. When P is inside, clearly the four angles add to 360°. If P is outside the tile then one of the angles will be the largest but less than 180° and the other three will add up to be the same as it, also less than 180°. So the total is less than 360°. For a kite this is an infallible test to see if a point is inside it or outside it.

Note: The four angles are always ∠APB, ∠BPC, ∠CPD, ∠APD and they are always measured the 'small' way so that they are less than 180°.

Darts

Sadly this is not an infallible test for dart shaped quadrilaterals when one internal angle is greater that 180° as we see in the three examples below:


Once we get further inside a dart things work better as can be illustrated by the graph below. We have a downward pointing dart (slightly exaggerated) and a horizontal yellow line passing through it. There are four points shown on the line: ##P_1,P_2,P_3,P_4##. A point on the green line shows the total angle (in radians) from the point above it on the yellow line to the four vertices. So
The first point which is outside the dart is ##P_1,total<2π ##
The second which is on the edge of the dart is ##P_2,total=2π ##
The third which is inside the dart is ##P_3,total=2π  ##
The fourth which is on another edge of the dart is ##P_4,=2π   ##

We can easily draw more graphs with the yellow line at different levels:

Our test would say that points inside the wing tips of the dart were not inside it.

For a kite the behaviour is much better:
These are all plotted and animated in Penrose Tile Plotter.xlsm. And here are the videos which demonstrate the limited but adequate validity of the method!

It is instructive to pause the videos at interesting points. The point P and the dashed lines to the vertices are there for illustrative purposes. The yellow and green lines are the important ones.




Wednesday, 24 April 2019

Wolfram Mathworld great circle equation error

On rereading the Wolfram article, their equation (9) is ##\phi=\delta=\pi / 2 - v##, so ##v## is the colatidude. I can only forgive myself because they earlier say ##\delta=90°-\phi##. It would be helpful if they wrote "where ##a## is the radius of the sphere, ##c_1,c_2## are constants of integration, ##u,v## are respectively longitude and colatitude" under their equation (19).

According to www.mathworld.wolfram.com/GreatCircle.html (19) the geodesic equation on a sphere (great circle) is given below. It is derived from a somewhat specialised equation for a geodesic on a surface (http://mathworld.wolfram.com/Geodesic.html (30)), which itself is derived by considering a minimised line integral. Wolfram's (19) is given as
\begin{align}
a{\mathrm{cos} u\ }{\mathrm{s}\mathrm{i}\mathrm{n} v\ }{\mathrm{sin} c_2\ }+a{\mathrm{sin} u\ }{\mathrm{s}\mathrm{i}\mathrm{n} v\ }{\mathrm{cos} c_2\ }-\frac{a{\mathrm{c}\mathrm{o}\mathrm{s} v\ }}{\sqrt{{\left(\frac{a}{c_1}\right)}^2-1}}=0 & \phantom {10000}(1) \\
\end{align}where ##a## is the radius of the sphere, ##c_1,c_2## are constants of integration, ##u,v## are respectively longitude and latitude. In the next equation it recasts that in Cartesian coordinates as\begin{align}
x{\mathrm{sin} c_2\ }+y{\mathrm{cos} c_2\ }-\frac{z}{\sqrt{{\left(\frac{a}{c_1}\right)}^2-1}}=0 & \phantom {10000}(2) \\
\end{align}"which shows that the geodesic giving the shortest path between two points on the surface of the equation lies on a plane that passes through the two points in question and also through center of the sphere." (2) is indeed the equation of a plane which contains the origin, but it also implies that\begin{align}
x=a{\mathrm{cos} u\ }{\mathrm{s}\mathrm{i}\mathrm{n} v\ }\ \ ,\ y=a{\mathrm{sin} u\ }{\mathrm{s}\mathrm{i}\mathrm{n} v\ }\ \ ,\ z=\ a{\mathrm{c}\mathrm{o}\mathrm{s} v\ } & \phantom {10000}(3) \\
\end{align}This is very wrong. It would be correct if ##v## was the colatitude (angle measured from the pole). The colatitude is normally called  ##\phi ## and  ##\phi ={\pi }/{2}-v##, as they say in their #7. Alternatively one can swap all ##{\mathrm{sin} v\ },{\mathrm{cos} v\ }##. I guessed that the equation is therefore\begin{align}
a{\mathrm{cos} u\ }{\mathrm{cos} v\ }{\mathrm{sin} c_2\ }+a{\mathrm{sin} u\ }{\mathrm{cos} v\ }{\mathrm{cos} c_2\ }-\frac{a{\mathrm{sin} v\ }}{\sqrt{{\left(\frac{a}{c_1}\right)}^2-1}}=0 & \phantom {10000}(4) \\
\end{align}This is correct as I have proved by other means. (Here). Numerically it can be shown with my great 3-D graph plotter (here and here). The incorrect equation is obviously not a great circle, whereas the correct one looks plausible;

The schematic shows great circles between cities. The right hand one shows the London-Peking great circle according Wolfram Mathworld. Perhaps this is what happened to the British Airways pilot who flew from London to Edinburgh instead of Düsseldorf in a month ago. (On the BBC here)

I have not been able to trace the source of the error in the Wolfram Mathworld proof. It may go as far back as their (7) where they might have intended to introduce ##\phi ##.

This error on Wolfram Mathworld caused me a lot of grief!

And another small error

There is also a typo on http://mathworld.wolfram.com/Geodesic.html between equations (11) and (12). It reads "Starting with equation (##\mathrm{\Diamond }##)" which should be "Starting with equation (5)"

Sunday, 21 April 2019

3-D Graph plotter Version 2

Paul showed me how to write VBA for an Excel spreadsheet. David had also urged me to look at the Timer function in VBA to speed up production of animations on the 3-D Graph plotter. I dedicate this post to Paul and David.

Inspired by both of them I have put an animation feature in the 3-D graph plotter and here are the results.  All the movies had to be adjusted in html to make them bigger. The old method of screenshots into a .gif file is shown. It has some merits. I used the MS-Windows screen recorder to produce the .mp4 file. It is very clunky. It would be nice to be able to delineate the area of the screen one wished to record more precisely.

The geodesic plotter, I am still working on the equations :-(
On youtube here which is bigger 
Original mp4 here which is bigger and clearer.
Excel file here.

The same sphere produced painstakingly from 36 screenshots each 10° apart.


The cube from an .mp4 file loaded directly onto Blogger. Excel file here.

The cube from the.mp4 file first uploaded to Youtube. On Youtube here.
A similar cube produced painstakingly from 44 screenshots.

Saturday, 30 March 2019

Here we meet the covariant divergence and prove a thing or two about it. (Carroll said it was 'easy'.) We also have the curved-space version of Stokes's theorem using the covariant derivative and finally the exterior derivative and commutator, where Carroll seems to have made a very peculiar typo. Sir George Gabriel Stokes, 1st Baronet was a very clever but he did not discover the theorem. He popularised it.



Here's the very impressive Stokes's theorem, which applies to the diagram
$$\int^{\ }_{\mathrm{\Sigma }}{{\mathrm{\nabla }}_{\mu }V^{\mu }\sqrt{\left|g\right|}}d^nx=\int^{\ }_{\mathrm{\partial }\mathrm{\Sigma }}{n_{\mu }V^{\mu }\sqrt{\left|\gamma \right|}}d^{n-1}x
$$
At Carroll's (3.36) he says "if ##\mathrm{\nabla }## is the Christoffel symbol, ##{\omega }_{\mu }## is a one-form, and ##X^{\mu }## and ##Y^{\mu }## are vector fields, we can write
$${\left(\mathrm{d}\omega \right)}_{\mu \nu }=2{\partial }_{[\mu }{\omega }_{\nu ]}=2{\mathrm{\nabla }}_{[\mu }{\omega }_{\nu ]}
$$The phrase "if ##\mathrm{\nabla }## is the Christoffel symbol" is bizarre and it is easy to prove the equation without it, assuming the Christoffel connection is torsion-free (##{\mathrm{\Gamma }}^{\lambda }_{\mu \nu }={\mathrm{\Gamma }}^{\lambda }_{\nu \mu }##). I think our author meant "if the connection is torsion-free".

Read more at Commentary 3.2 Properties of covariant derivative.pdf (7 pages)