#KMP Drawer with Graphviz
Given a pattern string, it generates the Graphviz dot script to draw the implicit automaton that uses the KMP string matching algorithm.
To compile:
g++ -std=c++0x -Wall kmpdraw.cpp -o kmpdraw
Example:
#KMP Drawer with Graphviz
Given a pattern string, it generates the Graphviz dot script to draw the implicit automaton that uses the KMP string matching algorithm.
To compile:
g++ -std=c++0x -Wall kmpdraw.cpp -o kmpdraw
Example:
original_image = imread('butterfly.jpg'); | |
[n m c] = size(original_image); | |
assert(c == 3); | |
angles = linspace(0, 20 * pi, 1000); | |
for i=1:length(angles) | |
radius = 200; | |
c = 0.5 + sin(angles(i)) / 2; | |
[x y] = meshgrid(1:m, 1:n); |
SpecialPlane horPlane = new SpecialPlane(0,0.2, new PVector(253, 184, 19)); | |
SpecialPlane parPlane = new SpecialPlane(1, 0.5, new PVector(246, 139, 31)); | |
SpecialPlane obPlane = new SpecialPlane(0.5, 0.3, new PVector(241, 112, 34)); | |
VPlane vertPlane = new VPlane(-0.4, new PVector(238, 246, 108)); | |
boolean[] visible = {true, true, true, true, true}; // which parts of the cone are visible | |
float rotY = 0, rotX = 0; | |
PVector[][] ps = generatePoints(100); | |
void setup() { |