Thursday, November 3, 2016

Semi-dimensional shapes and other curves

I just discovered that shapes with half-integer dimensions have a simple square construction by subdividing by 4. An example is labelled the quadratic type 2 curve (or sometimes Minkowski sausage) with dimension 1.5. However this curve comes in a left and right handed form. Another example I made here:

It is also possible to build 2.5D surfaces, an example is here, however this surface intersects. It is possible to make a non-intersecting surface, which is approximately a 3D version of the above:

And here's a 1.5D curve in 3D space:
A 2.5D curve in 3D space is a bit more of a challenge

These ideas are explored in some more detail in my book Exploring Scale Symmetry, published by World Scientific.

Monday, September 19, 2016

Crumpled surface fractals

When we say a rope is 3m long, we have in mind a metre as a straight line, and when we say our garden is 60m^2, the m^2 is a solid flat square. The line and the square are archetype examples of the measures of length and area respectively. When we measure the size of a curve between dimension 1 and 2, a sensible archetype is the variable angle Koch curve. The bend angle exemplifies a rough curve of any dimension between 1 and 2.

When it comes to rough surfaces there appears to be no useful archetype, parametrised by dimension. I give some good candidates for such an archetype here.

An interesting alternative is a fractal surface that is a non-smooth developable surface, so has zero Gaussian curvature (or, technically, its discrete equivalent) everywhere and could be made out of paper (if self intersection were allowed). It is not immediately obvious how to generate fractals that have this property.

The trick is to note that a Koch curve itself can be built from a sequence of corrugations, each twice the size of the previous, and we can perform these corrugations using reflections on the surface, which maintain the curvature (or discrete equivalent of curvature) of zero. One can then apply this to a surface by doing the corrugations in two directions:
Each iteration we pitch the surface by the bend angle, reflect in two horizontal planes to produce corrugations, then rotate the surface by the yaw angle, which is 90 degrees in this case. Above we see the first five iterations.

The bend angle is variable, giving a range of dimensions from 2 up to some value less than three:
Notice that the fractal is built of multiple square spirals. Here we see bend angles π/24, π/12, π/8 and π/6. It is not known at what point the surface begins to intersect, it could be any angle > 0, but visually, there seems to be little in the way of intersection, even at π/6, which is a nice feature to have in the main.
close ups for bend angle π/12:


Apart from the bend angle, there are multiple yaw angles possible:
yaw angle = π on the left gives an extruded Koch curve (reflected at the mid point), π/2 is my chosen default surface seen above, π/3 gives hexagonal spirals, and on the right is π*2/3 which seems quite similar.
A close up of these triangular patterns:
These look slightly less regular than the square pattern, so more like crumpled up foil. If we want a randomised crumple a good choice is π/phi (the golden ratio):
While it still shows a bit of a pattern, this is because we are looking at the centre point (0,0,0), if we picked an arbitrary square section of the surface it would give a good resemblance to crumpled paper:
Therefore the family of fractal surfaces defined by the yaw angle (and bend angle) generalise the Koch curve, polygonal spiral crumples and a random crumpled surface. And the bend angle allows any level of crumpling.

To my knowledge this is the first fractal developable surface, and could make for a simple and useful archetype for rough surfaces in nature. Unlike the previous ones I have given, this surface has no hills or troughs and so is more like a tree of ridges and a tree of valleys, which is quite a good model for many landscapes, it also seems to be quite a good description for rough rocky surfaces and of course crumpled paper.

If we define the bend angle as φ and the yaw angle as θ, then generation algorithm is as follows, starting with a flat sheet spanning (-0.5,-0.5,0) to (0.5,0.5,0):
  1. yaw around origin by θ degrees
  2. φ degrees
  3. calculate scale s so concertinas are multiples (harmonics) along the same axis: 
  4. scale (dilate) around origin by s
  5. reflect around the horizontal planes (0,0,m) and (0,0,-m) to concertina the surface, where and i is the iteration count, giving larger concertinas each iteration. k controls how large the smallest concertina is.
  6. go to 1. until nothing is being reflected.
The calculation of s requires some explanation. What we want is for the concertina for a given horizontal axis to have the same length (so the same number of bends) when we return to that axis, i.e. after a turn of 180 degrees. If it has the same length then the formula for m will ensure that subsequent concertinas will be exactly double then quadruple the size etc. These are called octaves, and a consequence of using precise octaves is that the fractal folds are the same across the surface. The calculation of s is simple for integer divisions of π, but for non-integer θ the function s(θ) is not continuous, and in the general case, for irrational numbers the exponent of s is 2/π.

Note that, while various yaw angles are possible, only the default, π/2 gives a simple mesh for all bend angles.
A simple mesh means that for any given maximum concertina size, the mesh is a repeating lattice (a tiling).

This fold map shows the folds up to the first 7 iterations. We can also view how the fold map changes with bend angle:
In this case the shade goes from light to dark from bend angle π/36 to 8π/36 (almost maximum). The small corrugations seem to vary surprisingly little with bend angle but the final large corrugations seem to vary most.
Here is a render in Blender, for bend angle 15 degrees, where the centre of yaw is the bottom right corner. Which is equivalent to just looking at an offset patch of the fractal, from (0,0) to (1,1). Notice that the bottom edge is a Koch curve of bend angle 15 degrees (but with out of plane bends to the curve). The right edge is also this Koch curve. The fractal square spirals are also less obvious in this picture. 

From these renderings it is clear that self intersection does take place at least in the 15 degree case, and most likely for all bend angles > 0. In the 15 degree case the overlap only seems to account for about 0.1% of the landscape area, and increases for larger bend angles. Therefore this fractal is immersed in 3D space, but not embedded within it. 

Here's bend angle 22.5. Can you spot the self intersection?

It is a bit hard getting a good sense of depth, both depth-of-field and fog reduce the quality. Here I try adding four different coloured local light sources and I think it helps to distinguish the depth. For bend angle from 0 to 22.5 degrees:

Although the actual folding of the triangle mesh is quite complicated as the iterations build up, the actual fold curve on the piece of paper tends to a constant shape, which when not doing the largest corrugations is a repeating curve. The single repeating pattern looks like this for a 7.5 degree bend angle:
So as the iterations increase all folds look like some repetition of this on the flat paper.

The Hausdorff dimension D is a function of the bend angle φ:
So the surface has dimension 2 when the bend angle is 0, and dimension 3 when it is 45 degrees, which is equivalent to the maximum bend (dimension 2) Koch curve on each axis. Since the surface has overlap, some of the 'volume' of such a surface is due to the overlap, just like a dimension 2 Levy curve.

Since the shape derives from a flat surface it is possible to texture the surface, here is an example using the golden ratio yaw angle and a random location, to give a crumpled look:

The code for this is available on https://github.com/TGlad/CrumpleSurface, it generates a .ply file. 
The executable is here, run with -h for help, and example meshes here:
This shape is also compared with other variable dimension surfaces here, and in this article.

Finally, here's a little sequence of random meshes going from 7.5 bend angle up to 30 degrees, with some forest texture and a road:
The rainforest effect works quite well with the rougher meshes. This whole technique is potentially quite useful for computer games because it uses a square texture without any distortion. For 90 degree yaw angles at least the shape tiles, along with the texture. In addition lower and higher detail versions are inherent and share the same properties. The downside is the self intersections happen, but at least with the random location case (like above) you can try out different random seeds to minimise this.  

Monday, March 2, 2015

Conformal transforms in Minkowski space

I'm writing this mainly for my record, the question is what does a conformal transformation of Minkowski space look like?
The reason it is an interesting question is that relativistic physics is based on Minkowski space (or distorted versions) and the most fundamental symmetry of this is conformal symmetry.

The answer is a combination of:

  • translations
  • scales
  • rotations
  • boosts
  • inversions (which invert the distance metric (positive or negative), so flip around the double hyperboloid in the time-like region and around the hyperboloid of revolution in the space-like region).
However, this isn't totally useful as it doesn't give a clear image of your average conformal transformation. For comparison, we can define any arbitrary conformal transformation of 3d Euclidean space as:

An arbitrary rotation around an arbitrary circle in space. 

This covers all cases, sometimes in degenerate form, for example an ordinary rotation is when the circle has infinite radius, an ordinary translation is the limit as the radius increases, the circle becomes farther away and the rotation around it decreases.

The equivalent definition for 3+1 Minkowski space can be described in two ways, in terms of linear operations (e.g. rotations, boosts) or in terms of curvature. In both cases the transform is described in the time-like region when it involves a time flip, and in the space-like region when it involves a space flip:
Linear 
Space-like:
An arbitrary rotation around an arbitrary circle in space, with equal and opposite arbitrary boosts through the circle at two times around an arbitrary point in time. 
Time-like:
An arbitrary boost through an arbitrary sphere in space at an arbitrary point in time. 
Curvilinear 
Space-like:
An arbitrary cupping (positive curvature) of space together with an arbitrary (boost) acceleration through the axis of the bulge. 
Time-like:
An arbitrary radial expansion/contraction at an arbitrary point in space and time.
I'm still not sure if this covers all combinations of transforms but it seems close at least. It is a nice and simple generalisation of 'rotation around a circle' for space-like regions and 'boost through a plane' for time-like regions. 

Sunday, February 15, 2015

Tetrahedral wrapping function

A useful result of mapping complex numbers to the Riemann sphere is that elementary functions like z^2 and z^3 can be interpreted geometrically. 
z^2 wraps the sphere around onto itself, take the one faced spherical polyhedron shown above, cut it along the shown arc and stretch it around itself, as if doubling the longitude coordinates, until you can sew it back up at the original cut. The space naturally pinches toward the two poles such that the transform remains conformal. This is z^2.
Similary, z^3 takes the two-faced spherical polyhedron and wraps it around onto itself, as if stretching the complex plane by tripling the longitude around for example the Greenwich meridian.
z^4 wraps a three-faced spherical polyhedron onto itself, and z^5 wraps a four-faced spherical polyhedron onto itself. These shapes are all called hosohedra
Given this interpretation, it is interesting to consider mappings that wrap other spherical polyhedra onto themselves. Afterall, while the first two example hosohedra are regular, the three and four faced ones are not. The four faced hosohedra is also an unstable partition of the sphere in some senses, the stable and regular four faced spherical polyhedron is a spherical tetrahedron:


So it is interesting that you can indeed wrap a spherical tetrahedron onto itself, and it does remain conformal. The function is this:
If the complex plane origin is point D in the above image then the constants in the numerator of the product are the vertices A,B and C. The constants in the denominator are the poles which map to the centre of the spherical triangle ABC, they are located at the centre of the three remaining spherical triangles. 
The mapping can be visualised on the complex plane using David Bau's complex function viewer:
The grey circles are the unit disk in the complex plane, so you can see that this function can equally be seen to map a two sided spherical polyhedra (the the edge being the unit disk) to a spherical octahedron.
This animation I made shows the fold as applied to a non-spherical tetrahedron:


This tetrahedral wrapping function, for which I'll use the letter tau, can be simplified slightly if we allow it to wrap onto its dual tetrahedron (so removing the minus sign) and rearrange slightly to:


The mandelbrot set of this function requires care to visualise, unlike the standard mandelbrot set it doesn't bailout on large values. The only parts not in the set are those that hit a pole and so remain at infinity, you can do this by iterating the radius of the pixel, not just the point, and bailing out when either of the three poles are within this radius. Here I view it using Fractal Lab:



I find the look of this fractal to be quite different to others, even though you can clearly see mandelbrot elements within it. Here are two more close ups of the holes:

and here is part of the negative tau version:

You can also apply this function as a form of Mandelbulb fractal. In this case the transform operates on a real cartesian sphere around the origin, and the radius or each point squares each iteration, the mandelbrot version gives:
which was rendered using Fragmentarium.

Dihedral version

While the above function is I think quite unique as a regular polyhedron that wraps onto itself, it is also possible to do so with a two-sided spherical polyhedron called a Dihedron {4,2} (which means four vertices and two faces):
The wrap is similar to taking a square (with two sides, like an envelope) and folding in half then in half again to form a smaller square, but in our case it is done on the inflated/spherical surface.
The function is:
Which can be visualised here. You can visualise the mandelbrot set of it by using its reciprocal:



Wow, these are great pics.. and the negative version:


It also produces a mandelbulb which has some similarities to the tetrahedral version: