Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Path transformations
#32
New version is 0.24. One new plugin, Exponential map, and no more will be coming (unless somebody has some good suggestion).

The new plugin implements the complex exponential function. That is, the plane is viewed as the complex number plane C, and the plugin performs exp:C->C (with some embellishments). The plugin resembles the plugin To polar coordinates a lot. Main differences:
  • In addition to central angle (alpha), Exponential map takes as input another angle, so-called polar slope angle (gamma).
  • Exponential map is conformal. To polar coordinates is not.
  • Exponential map sends straight lines generally onto logarithmic spirals while To polar coordinates sends straight lines generally onto Archimedean spirals.
  • To polar coordinates offers choice of the side where the "pinching" is done: top, bottom, left, right. The plugin Exponential map offers the corresponding choice with similar effect, but now it has the meaning that it determines where the center of the logarithmic spirals will be.
The first picture shows the effect of alpha (central angle). The source path is the grid with two diagonal lines. Here gamma=0 and alpha=90, 180, 270, 360. The center is chosen to be "at the top".

   

Compare the figure with alpha=90 with a similar picture for the To polar coordinates (post #30, first picture). I want to stress the point that, contrary to the plugin To polar coordinates, the circular rungs are now not equidistant but their distances from the center grow exponentially.

The second picture shows the effect of the angle gamma. It controls the shapes of the drawn logarithmic spirals.  Above we had gamma=0 (the default), and we got circular arcs from horizontal lines. Here gamma is 15, 30, 45, 60 (degrees). Where above with gamma=0 we had circular arcs, here we have logarithmic spiral arcs of various shapes.

   

(Please just take my word for it: they are logarithmic spirals. Of course nobody could tell from such short arcs.)

Then some experiments with different settings. Frankly, it would be nice if the effects of alpha and gamma would obey some more transparent logic. Now it is matter of experimenting.

   

Some playings. Here I used all the time "center at the top".

   

Some points: In the top row the last two figures are similar despite of different settings. This is partly accidental, partly it follows from the symmetry of the source path.

The second row shows that you can use this plugin to draw short logarithmic spirals. But this plugin is not good for that purpose. Try longer spirals, and it fails. My plugin Parametric curves is better for that purpose. (The problem is the approximation algorithm: it should be developed further.)

The rest of the post is mathematical. Just skip it if you are not interested. First I want to explain a little about the angles alpha and gamma. First, any logarithmic spiral has a center point. The spiral revolves indefinitely around that point never reaching it. See the middle row in the  previous picture. In the plugin, all straight line segments are transformed to logarithmic spiral arcs with a common center point. The plugin can mark that center point if so wished (makes a one-anchor path).

Assume that the plugin is applied by choosing the center to be at the top. Consider any horizontal straight line segment L. It is transformed to a logarithmic spiral arc. Then: (1) If the length of L equals the width of the bounding box of the path, the logarithmic spiral arc will appear in angle alpha when viewed from the center point. That is why I call alpha the central angle. (2) The spiral has its so-called polar slope angle to be equal to gamma. These rules do not hold for non-horizontal line segments.

(I refrain from explaining what the polar slope angle of the arc means, except that it is the angle between the arc and any circle centered at the center point. A remarkable feature of the logarithmic spiral is that that angle is constant along the whole spiral!)

When I was working out the mathematics for the two plugins, I noticed a connection I had never realized before. I simplify now things in this explanation. The exponential map exp(z):C->C can be written, setting z=x+iy where i is the imaginary unit, as

exp(z) = exp(x+iy) = exp(x)exp(iy).

The formula behind the To polar coordinates plugin, on the other hand, when we use the "left" edge, is something like (x,y) -> x(cos(y),sin(y)), and if we write this as a complex function C->C, it reads

x+iy -> x exp(iy).

But both of these are of the form

x+iy -> f(x)exp(iy)

where f(x) is some real function! The exponential map has f(x)=exp(x), and the polar plugin has f(x)=x. In the expression f(x)exp(iy), the factor exp(iy) determines in which angle the point is located (the angle taken relative to the positive real axis). The factor f(x) determines the distance from the origo; we could call f(x) the "radial function". The difference in the two radial functions f(x) reflects directly the difference between the two plugins I mentioned above: in the polar plugin the circular rungs became equidistant but in the exponential plugin their distances grew exponentially (from the center).

And that naturally suggests that this all could be generalized. One could make plugins for several choices of f(x); or one could make one general plugin where the radial function f(x) is given as input, adding much flexibility to the plugin. And the ambition and curse of a mathematician is the urge to do everything as general as possible. But this idea is hardly worth the trouble to follow; I mention this all just because it is a curious fact. Of all the possibilities (the infinitely many different f(x)'s), only two seem practical:

  1. the plugin To polar coordinates since it resembles the filter Distorts>Polar coordinates with which everybody is familiar already;
  2. the plugin Exponential map since it is conformal. (And in fact, f(x)=exp(x) is the only radial function which gives a conformal mapping!)
Reply


Messages In This Thread
Path transformations - by Ottia Tuota - 04-22-2020, 10:34 AM
RE: Path transformations - by Ottia Tuota - 04-22-2020, 12:27 PM
RE: Path transformations - by Ottia Tuota - 04-24-2020, 10:28 AM
RE: Path transformations - by Zero01 - 04-24-2020, 09:25 PM
RE: Path transformations - by Ottia Tuota - 04-26-2020, 06:36 AM
RE: Path transformations - by Ottia Tuota - 05-04-2020, 10:01 AM
RE: Path transformations - by Ottia Tuota - 06-08-2020, 11:08 AM
RE: Path transformations - by Ottia Tuota - 06-09-2020, 05:08 PM
RE: Path transformations - by Ottia Tuota - 07-12-2020, 12:50 PM
RE: Path transformations - by Ofnuts - 07-12-2020, 11:33 PM
RE: Path transformations - by Ottia Tuota - 07-13-2020, 06:15 AM
RE: Path transformations - by Ottia Tuota - 07-13-2020, 05:15 PM
RE: Path transformations - by Ottia Tuota - 07-14-2020, 02:23 PM
RE: Path transformations - by Ofnuts - 07-14-2020, 04:02 PM
RE: Path transformations - by rich2005 - 07-15-2020, 09:20 AM
RE: Path transformations - by Ottia Tuota - 07-15-2020, 11:38 AM
RE: Path transformations - by Ottia Tuota - 07-16-2020, 11:42 AM
RE: Path transformations - by Ottia Tuota - 07-26-2020, 07:26 AM
RE: Path transformations - by Ottia Tuota - 08-05-2020, 06:13 PM
RE: Path transformations - by Ottia Tuota - 08-07-2020, 07:25 AM
RE: Path transformations - by Ottia Tuota - 08-11-2020, 08:39 AM
RE: Path transformations - by Ofnuts - 08-07-2020, 08:23 AM
RE: Path transformations - by Ottia Tuota - 08-07-2020, 12:06 PM
RE: Path transformations - by Ofnuts - 08-08-2020, 12:58 PM
RE: Path transformations - by Ottia Tuota - 08-08-2020, 01:33 PM
RE: Path transformations - by mahvin - 08-07-2020, 01:55 PM
RE: Path transformations - by Ottia Tuota - 08-07-2020, 07:26 PM
RE: Path transformations - by mahvin - 08-07-2020, 07:56 PM
RE: Path transformations - by Ottia Tuota - 08-07-2020, 08:15 PM
RE: Path transformations - by Ottia Tuota - 09-03-2020, 11:43 AM
RE: Path transformations - by Ottia Tuota - 09-04-2020, 11:29 AM
RE: Path transformations - by Ottia Tuota - 09-19-2020, 01:00 PM

Forum Jump: