### PULSATING & SWEEPING ROSE PATTERN ## Built by Vampyrium ## Ver. 1.0.1.1 2017-10-14 12:28 PM EDT ## Use with rectangular coordinates, AT LEAST 200 beams (20 x 10) for best results ## VAMPYRIUM'S NOTES ## "fraction" is not used here due to its range of [0,1]. Since we're working ## with angles and a design that loops here, that has the potential of causing ## two beams to shine in the same spot at the "beginning"/"end" where the ## design loops. The "relindex" implementation below obviates this issue. ## ## The laser expression feature as a whole is meant for exploration and ## experimentation, but if you don't know what you're doing, just try ## changing the values in the "Configuration" section. If using whole ## numbers for "k", try a maxangle of 2*pi (or tau) for even numbers and pi for ## odd numbers. ## ## Much more information on rose graphs can be found here, if you're so inclined: ## https://en.wikipedia.org/wiki/Rose_(mathematics) # Initialization relindex = index/count; ## CONFIGURATION OPTIONS ## time_offset: Used for changes over time (color changes, sweep effect) ## k and c: Changes the pattern's shape (refer to Wikipedia link) ## For c, the default value is an equation using the ## time_offset to create a slight pulsating effect. ## size: Scales the pattern up or down (default: 100) ## maxangle: Max value of theta in parametric equations. Adjust if ## pattern is incomplete or if beams are overlapping. ## color_hue_width: Span of hue values being shown at once ## color_change_speed: Speed of the color changing effect ## sweep_effect_factor: Higher factors lead to tighter and more numerous bands ## in the sweeping effect. ## sweep_speed: Speed of the sweeping effect # Configuration time_offset = time; k = 0.4; c = cos(time_offset) * 0.05; size = 100; maxangle = pi * 10; color_hue_width = 120; color_change_speed = 120; sweep_effect_factor = pi * 8; sweep_speed = 3; # Masks firsthalf = (relindex < 0.5); lasthalf = (firsthalf < 1); # Expression relangle = relindex * maxangle; size_cos_k_relangle_c = (size * cos(k * relangle)) + c; x' = size_cos_k_relangle_c * cos(relangle); y' = size_cos_k_relangle_c * sin(relangle); h = (((relindex * firsthalf) + ((1-relindex) * lasthalf)) * color_hue_width) + (time_offset * color_change_speed); s = 1; v = ((cos((relindex * sweep_effect_factor) + (time_offset * sweep_speed))) / 2) + 0.5;