Inelegant Interference Pattern (elegants inquire within)
Posted: Tue Jul 12, 2005 1:37 pm
I'm playing around trying to simulate an interference pattern like you get in a wave pool from the interacting ripples. Here's what I've got so far, which is far from elegant:
I'd love to see some other approaches to this. For instance, I tried doing the line drawing recursively, but that caused the image to expand to infinity and become too small to be drawn at all. There also must be a more visually-appealing way to draw the waves aside from this chunky method I'm using.
Code: Select all
startshape SCENE
rule SCENE{
FAN{}
FAN{x 40 y 40 r 180}
FAN{x 40 r 90}
FAN{y 40 r -90}
}
rule FAN{
LINE {}
LINE {r 5}
LINE {r 10}
LINE {r 15}
LINE {r 20}
LINE {r 25}
LINE {r 30}
LINE {r 35}
LINE {r 40}
LINE {r 45}
LINE {r 50}
LINE {r 55}
LINE {r 60}
LINE {r 65}
LINE {r 70}
LINE {r 75}
LINE {r 80}
LINE {r 85}
LINE {r 90}
}
rule LINE {
CIRCLE { s 0.1}
CIRCLE { x 1 s 0.2}
CIRCLE { x 2 s 0.3}
CIRCLE { x 3 s 0.4}
CIRCLE { x 4 s 0.5}
CIRCLE { x 5 s 0.4}
CIRCLE { x 6 s 0.3}
CIRCLE { x 7 s 0.2}
CIRCLE { x 8 s 0.1}
CIRCLE { x 9 s 0.2}
CIRCLE { x 10 s 0.3}
CIRCLE { x 11 s 0.4}
CIRCLE { x 12 s 0.5}
CIRCLE { x 13 s 0.4}
CIRCLE { x 14 s 0.3}
CIRCLE { x 15 s 0.2}
CIRCLE { x 16 s 0.1}
CIRCLE { x 17 s 0.2}
CIRCLE { x 18 s 0.3}
CIRCLE { x 19 s 0.4}
CIRCLE { x 20 s 0.5}
CIRCLE { x 21 s 0.4}
CIRCLE { x 22 s 0.3}
CIRCLE { x 23 s 0.2}
CIRCLE { x 24 s 0.1}
CIRCLE { x 25 s 0.2}
CIRCLE { x 26 s 0.3}
CIRCLE { x 27 s 0.4}
}