September 24, 2023

– Advertisement –

By negating the incomplete elliptic function of the first kind by \(F(z \,|\, m)\) , the function \[ \varphi(z) = -\sqrt{i} \, F\bigl(i \sinh^{-1}(\sqrt{i} \, z) \,|\,
-1 \bigr). \]
is an analogous mapping from the class \([-1,1] \ Times [-1,1]\) for a concentric circle. I learned that here.

Then, if one has a square image, we can convert it to a circular image with the help of this function \(\varphi\) . I’ll give an example.

– Advertisement –

One can instead use the function \(\psi(z) = \varphi(z)/\varphi(1)\) to obtain an analogous mapping from this square to the unit circle. I’ll use it. And I’ll call this class the entity class.

First, let’s do a pretty complicated function on a square. I take the Weierstrass zeta function.

– Advertisement –

library (Jacobi) # to get the `wzeta` function library (RcppColors) # to get the `colorMap1` function # vectorize the Weierstrass zeta function f

– Advertisement –

I hope you like it. Now we will map this image to a circle.

We first calculate the values ​​of \(\psi\) on a grid of unit squares:

library(carlson) # to get `ellipse_F` function # `psi` function w
We will need to interpolate the values ​​of the Weierstrass zeta function stored in the ZETA matrix. To do this, we introduce two functions, one to interpolate the real parts, the other to interpolate the imaginary parts:

library (cooltools) # `approxfun2` function to get x_
Note that these two functions are defined on the Entity class. And the cooltools package is really cool.

Now it’s easy. With the help of these two functions, we map the values ​​of \(\psi\) stored in the PSI matrix:

See also  R | How to add straight lines to a plot in R Bloggers

Now we convert this complex matrix into a matrix of colors, and we plot it:

# map the complex matrix to a matrix of colors img

Source link

– Advertisement –