Lissajous Curves/Figures

User avatar
GeorgeMcGinn
Posts: 435
Joined: Sat Sep 10, 2016 6:37 am
My devices: IPad Pro 10.5in
IMac
Linux i386
Windows 7 & 10
Location: Venice, FL
Flag: United States of America
Contact:

Re: Lissajous Curves/Figures

Post by GeorgeMcGinn »

Hi Henk,

I love it. I see you have six types, but I was under the impression that there were an infinite number.

Is the infinite in the multi phases within each box since they change form?

Thanks.
Henko wrote:
Wed May 31, 2017 9:46 pm
graphics ! graphics clear .8,.8,.8
d=56 ! option angle degrees
fill color 1,1,1 ! refresh off
loop:
phaseX+=5 ! phaseY+=10
for i=0 to 2 ! for j=0 to 1
box(d+j*(300+d),20+i*320,300,300,.5,.5,15)
draw color 1,0,0 ! draw size 1
for a=0 to 720 step 2
x=9*sin((1+2*i)*a+phaseX) ! y=9*cos((1+1.5*j)*a+phaseY)
if a=0 then ! xo=x ! yo=y ! endif
draw_it(xo,yo,x,y) ! xo=x ! yo=y
next a
next j ! next i
refresh
goto loop

def box(xlu,ylu,width,height,xm,ym,scale)
org_x=xlu+xm*width ! org_y=ylu+(1-ym)*height
xrl=xlu+width ! yrl=ylu+height
draw size 4
draw color 0,0,0
fill rect xlu-4,ylu-4 to xrl+4,yrl+4
draw rect xlu-4,ylu-4 to xrl+4,yrl+4
draw size 1 ! draw alpha .2
step=scale
for x=org_x to xrl step step ! draw line x,ylu to x,yrl ! next x
for x=org_x to xlu step -step ! draw line x,ylu to x,yrl ! next x
for y=org_y to yrl step step ! draw line xlu,y to xrl,y ! next y
for y=org_y to ylu step -step ! draw line xlu,y to xrl,y ! next y
draw color 0,0,1 ! draw size 2 ! draw alpha 1
draw line xlu,org_y to xrl,org_y
draw line org_x,ylu to org_x,yrl
end def

def draw_it(xs,ys,xe,ye)
x1=box.org_x+box.scale*xs ! y1=box.org_y-box.scale*ys
x2=box.org_x+box.scale*xe ! y2=box.org_y-box.scale*ye
draw line x1,y1 to x2,y2
end def
George McGinn
Computer Scientist/Cosmologist/Writer/Photographer
Member: IEEE, IEEE Computer Society
IEEE Sensors Council & IoT Technical Community
American Association for the Advancement of Science (AAAS)

Henko
Posts: 814
Joined: Tue Apr 09, 2013 12:23 pm
My devices: iPhone,iPad
Windows
Location: Groningen, Netherlands
Flag: Netherlands

Re: Lissajous Curves/Figures

Post by Henko »

Hi George,
The coefficients in X=ampl * sin ( omega * parameter + shift ) and Y = .....
are chosen in such a way that they produce 6 figures in ascending complexity. They change form due to the fact that the "shift" coefficients are modified a little bit in each loop.
I didn't know about Lissajoux "knots", interesting!

User avatar
GeorgeMcGinn
Posts: 435
Joined: Sat Sep 10, 2016 6:37 am
My devices: IPad Pro 10.5in
IMac
Linux i386
Windows 7 & 10
Location: Venice, FL
Flag: United States of America
Contact:

Re: Lissajous Curves/Figures

Post by GeorgeMcGinn »

I found the Knots interesting too. Let's see if we can code it.
Henko wrote:
Thu Jun 01, 2017 9:17 pm
Hi George,
...
I didn't know about Lissajoux "knots", interesting!
George McGinn
Computer Scientist/Cosmologist/Writer/Photographer
Member: IEEE, IEEE Computer Society
IEEE Sensors Council & IoT Technical Community
American Association for the Advancement of Science (AAAS)

User avatar
GeorgeMcGinn
Posts: 435
Joined: Sat Sep 10, 2016 6:37 am
My devices: IPad Pro 10.5in
IMac
Linux i386
Windows 7 & 10
Location: Venice, FL
Flag: United States of America
Contact:

Re: Lissajous Curves/Figures

Post by GeorgeMcGinn »

Thanks - I will try this out.

I am having some success using the TRI which allows me to use the three parameters that LINE does not.

George.
rbytes wrote:
Wed May 31, 2017 2:01 pm
Dr. Chip, is your code supposed to produce the color variations shown in your examples? I am only getting black and white images.

George, you won't get as realistic 3D shading as your rendered image, but you could still create get an impression of 3D.

When you draw the curves, start with black, increase it gradually to white for the first 1/3 of the iterations, stay white for the second third, and then gradually reduce intensity to black for the last 1/3. This will create a cylindrical look.
George McGinn
Computer Scientist/Cosmologist/Writer/Photographer
Member: IEEE, IEEE Computer Society
IEEE Sensors Council & IoT Technical Community
American Association for the Advancement of Science (AAAS)

Post Reply