Friday, January 18, 2019

Nested Ellipses (Ellipse Whirl)



These animations are constructed by shrinking and rotating
a sequence of concentric and similar ellipses,
so that each ellipse lies inside the previous ellipse and is tangent to it.

這些動畫是藉由收縮和旋轉
一序列同心且相似的橢圓來構造的,
使得每個橢圓都位於前一個橢圓內並與之相切。


All the angles of rotations are equal to 5°.


All the angles of rotations are equal to 10°.


All the angles of rotations are equal to 15°.


The angles of rotations are 0.5°, 1°, 1.5°, 2°, .....


All the angles of rotations are equal to 5°.


All the angles of rotations are equal to 5°.


All the angles of rotations are equal to the value of the animation parameter.


Related posts:


( Mathematical software used: GeoGebra )

Tuesday, December 12, 2017

Rotational Symmetry of Order 4

Making Patterns with Rotational Symmetry of Order 4 Using a n by n Grid of Random Shaded Squares

(1) n is even

(n = 12)

gnuplot script:

n = 12
m = n/2
max(x,y) = x>y?x:y
a = 0.875
f(t) = a*0.5*cos(2*pi*t) / max(abs(cos(2*pi*t)), abs(sin(2*pi*t)))
g(t) = a*0.5*sin(2*pi*t) / max(abs(cos(2*pi*t)), abs(sin(2*pi*t)))
funX(i,t) = f(t) + 0.5 + i
funY(j,t) = g(t) + 0.5 + j
set xrange [-m-1:m+1]
set yrange [-m-1:m+1]
unset key
unset tics
unset border
set margins 0,0,0,0
set size ratio -1
set samples 1000
set parametric
set trange [0:1]
Color = "#00cc00"
set style fill solid noborder
set terminal wxt 0 size 600,600 position 0,0 title "n = ".n
seed = ceil(2147483646*rand(time(0)))
random_test = rand((time(0),seed))
set multiplot
do for [i=0:m-1]{
    do for [j=0:m-1]{
        b = rand(0)>0.5?1:0
        if (!b) {continue}
        plot funX(i,t),  funY(j,t) w filledc closed lw 1 lc rgb Color, \
            -funY(j,t),  funX(i,t) w filledc closed lw 1 lc rgb Color, \
            -funX(i,t), -funY(j,t) w filledc closed lw 1 lc rgb Color, \
             funY(j,t), -funX(i,t) w filledc closed lw 1 lc rgb Color
    }
}
unset multiplot


(2) n is odd

(n = 11)

gnuplot script:

n = 11
m = (n+1)/2.
max(x,y) = x>y?x:y
a = 0.875
f(t) = a*0.5*cos(2*pi*t) / max(abs(cos(2*pi*t)), abs(sin(2*pi*t)))
g(t) = a*0.5*sin(2*pi*t) / max(abs(cos(2*pi*t)), abs(sin(2*pi*t)))
funX(i,t) = f(t) + i
funY(j,t) = g(t) + j
set xrange [-n/2.-1:n/2.+1]
set yrange [-n/2.-1:n/2.+1]
unset key
unset tics
unset border
set margins 0,0,0,0
set size ratio -1
set samples 1000
set parametric
set trange [0:1]
Color = "#00cc00"
set style fill solid noborder
set terminal wxt 0 size 600,600 position 0,0 title "n = ".n
seed = ceil(2147483646*rand(time(0)))
random_test = rand((time(0),seed))
set multiplot
b = rand(0)>0.5?1:0
if (b) {plot f(t), g(t) w filledc closed lw 1 lc rgb Color}
do for [i=1:m-1]{
    do for [j=0:m-1]{
        b = rand(0)>0.5?1:0
        if (!b) {continue}
        plot funX(i,t),  funY(j,t) w filledc closed lw 1 lc rgb Color, \
            -funY(j,t),  funX(i,t) w filledc closed lw 1 lc rgb Color, \
            -funX(i,t), -funY(j,t) w filledc closed lw 1 lc rgb Color, \
             funY(j,t), -funX(i,t) w filledc closed lw 1 lc rgb Color
    }
}
unset multiplot


(3) n is even (Non-Reflectional Symmetry)

(n = 12)

gnuplot script:

n = 12
m = n/2
max(x,y) = x>y?x:y
f(t) = 0.5*cos(2*pi*t) / max(abs(cos(2*pi*t)), abs(sin(2*pi*t)))
g(t) = 0.5*sin(2*pi*t) / max(abs(cos(2*pi*t)), abs(sin(2*pi*t)))
funX(i,t) = f(t) + 0.5 + i
funY(j,t) = g(t) + 0.5 + j
set xrange [-m-1:m+1]
set yrange [-m-1:m+1]
unset key
unset tics
unset border
set margins 0,0,0,0
set size ratio -1
set samples 1000
set parametric
set trange [0:1]
Color = "#00cc00"
set terminal wxt 0 size 600,600 position 0,0 title "n = ".n
seed = ceil(2147483646*rand(time(0)))
random_test = rand((time(0),seed))
set multiplot
do for [i=0:m-1]{
    do for [j=0:i]{
        b = rand(0)>0.5?1:0
        if (b) {
           plot funX(i,t),  funY(j,t) w filledc closed lw 1 lc rgb Color, \
               -funY(j,t),  funX(i,t) w filledc closed lw 1 lc rgb Color, \
               -funX(i,t), -funY(j,t) w filledc closed lw 1 lc rgb Color, \
                funY(j,t), -funX(i,t) w filledc closed lw 1 lc rgb Color
        }
        if (j==i) {continue}
        if (!b) {
           plot funX(j,t),  funY(i,t) w filledc closed lw 1 lc rgb Color, \
               -funY(i,t),  funX(j,t) w filledc closed lw 1 lc rgb Color, \
               -funX(j,t), -funY(i,t) w filledc closed lw 1 lc rgb Color, \
                funY(i,t), -funX(j,t) w filledc closed lw 1 lc rgb Color
        }
    }
}
unset multiplot


(4) n is odd (Non-Reflectional Symmetry)

(n = 11)

gnuplot script:

n = 11
m = (n+1)/2.
max(x,y) = x>y?x:y
f(t) = 0.5*cos(2*pi*t) / max(abs(cos(2*pi*t)), abs(sin(2*pi*t)))
g(t) = 0.5*sin(2*pi*t) / max(abs(cos(2*pi*t)), abs(sin(2*pi*t)))
funX(i,t) = f(t) + i
funY(j,t) = g(t) + j
set xrange [-n/2.-1:n/2.+1]
set yrange [-n/2.-1:n/2.+1]
unset key
unset tics
unset border
set margins 0,0,0,0
set size ratio -1
set samples 1000
set parametric
set trange [0:1]
Color = "#00cc00"
set terminal wxt 0 size 600,600 position 0,0 title "n = ".n
seed = ceil(2147483646*rand(time(0)))
random_test = rand((time(0),seed))
set multiplot
do for [i=0:m-1]{
    do for [j=0:i]{
        b = rand(0)>0.5?1:0
        if (b) {
           plot funX(i,t),  funY(j,t) w filledc closed lw 1 lc rgb Color, \
               -funY(j,t),  funX(i,t) w filledc closed lw 1 lc rgb Color, \
               -funX(i,t), -funY(j,t) w filledc closed lw 1 lc rgb Color, \
                funY(j,t), -funX(i,t) w filledc closed lw 1 lc rgb Color
        }
        if (j==0 || j==i) {continue}
        if (!b) {
           plot funX(j,t),  funY(i,t) w filledc closed lw 1 lc rgb Color, \
               -funY(i,t),  funX(j,t) w filledc closed lw 1 lc rgb Color, \
               -funX(j,t), -funY(i,t) w filledc closed lw 1 lc rgb Color, \
                funY(i,t), -funX(j,t) w filledc closed lw 1 lc rgb Color
        }
    }
}
unset multiplot


Graph files:


( Mathematical softwares used: Graph, gnuplot )

Sunday, November 12, 2017

Swastika Tiling

An implicit curve: swastika(x,y) = 0


The swastika here is an ancient Buddhist symbol, not the Nazi one.


Composition of swastika(x,y), arctan(x) and tan(x)
(k = 0.25)

Composition of swastika(x,y), arctan(x) and tan(x)
(k = 0.125)

Composition of swastika(x,y), arctan(x) and tan(x)
(k = 0.4)

Composition of swastika(x,y), arcsin(x) and sin(x)
(k = 0.25)

Composition of swastika(x,y), arcsin(x) and sin(x)
(k = 0.4)

Swastika of Swastikas
(k = 1/4, 5/24)

Swastika of Swastikas of Swastikas
(k = 1/4, 1/4, 5/24)

Swastika of Swastikas of Swastikas
(Unicode of 卍: 0x534D)

A Maze of Swastikas
(k = 0.1)


( Mathematical software used: Graph )


Related posts:

Friday, September 8, 2017

Funny Scalar Fields (Heat Maps) on a Surface

Heat Map on a Torus

Heat Map on a Torus

Scalar Field on a Torus

Scalar Field on a Möbius Strip

Scalar Field on a Möbius Strip


( Mathematical software used: gnuplot )

Funny Inequalities on a Torus

(1)

(2-1)

(2-2)

(3)

(4)

(5)

(6)

(7)

(8)

(9)

(10)
(11)

(12)


( Mathematical software used: gnuplot )

Friday, January 27, 2017

Plotting Slope Fields using Graph

y' = x² + y² - r²  (r = 0, 1, 2, ..., 7)


y' = (x + y)/(x - y)  (method 1)


y' = (x + y)/(x - y)  (method 2)


y' = sin(x)/y + sin(y)/x


y' = cos(x) + cos(y)


y' = cos(x) sqrt(1+x²) + cos(y) sqrt(1+y²)


Download Examples:


( Mathematical software used: Graph )

Saturday, January 7, 2017

A Monster Equation

x² + y² - a[exp(sin³(x-y)) + exp(sin³(-x-y))]² = c
  • x and y are variables.
  • a and c are parameters.


(a = 3, c = 0.5)

Scilab script:

clear;
clf();
xset("wdim",400,400);
xset("fpf"," ");
xset("thickness", 2);
square(-8.2,-8.2,8.2,8.2);

a = 3;
c = 0.5;
function z = fun(x,y)
   z = x^2 + y^2 - a*(exp(sin(x-y)^3) + exp(sin(-x-y)^3))^2 - c;
endfunction
data = linspace(-8.2, 8.2, 2000);

contour2d(data, data, fun, [0,0], style=color("red"), axesflag=0);



(a = -1, c = 24)


(a = -2, c = 50)


( Mathematical software used: Scilab )