RE: Post making contest 6.0
12-06-2017, 06:29 PM
(This post was last modified: 12-06-2017, 06:48 PM by Akumu.)
(12-06-2017, 07:53 AM)a52 Wrote: »// p.x and p.y are current coordinates
// v.x and v.y is a velocity at point p
vec2 get_velocity(vec2 p) {
vec2 v = vec2(0., 0.);
const float n = 10.;
float log2 = log(2.);
float pk = pow(2.,1.-p.x);
float c_re_top = 1. - pk*cos(p.y*log2);
float c_im_top = pk*sin(p.y*log2);
float c_bot = c_re_top*c_re_top +
c_im_top*c_im_top;
float sum1r = 0.;
float sum1i = 0.;
for (float k = 1.; k <= n; k++) {
pk = pow(k, -p.x);
if (k == 1.) {
pk = -pk;
}
float logk = log(k);
sum1r += pk * cos(p.y * logk);
sum1i += -pk * sin(p.y * logk);
}
float sum2r = 0.;
float sum2i = 0.;
for (float k = n + 1.; k <= 2.*n; k++){
pk = pow(k, -p.x);
if (k == 1.) {
pk = -pk;
}
float logk = log(k);
float ek = 0.;
for (float j = 0.; j <= n; j++) {
if (j <= k) {continue;}
float b = 1.;
for (float i = 1.; i <= n; i++) {
if (i == j) { break; }
b *= (n + 1. - i)/i;
}
ek += b;
}
sum2r += pk * cos(p.y * logk) * ek;
sum2i -= pk * sin(p.y * logk) * ek;
}
float pow2 = pow(2., -n);
float sumr = sum1r + pow2 * sum2r;
float sumi = sum1i + pow2 * sum2i;
v.x = (sumr * c_re_top - sumi * c_im_top)
/c_bot;
v.y = (sumr * c_im_top + sumi * c_re_top)
/c_bot;
return v;
}
glsl certainly has some quirks. i'll need to check this tomorrow, i'm certain i must have made a mistake in there somewhere.
This post passes rules 1, 2, and 3.
(12-06-2017, 07:53 AM)a52 Wrote: »https://anvaka.github.io/fieldplay/?dt=0...v%3B%0A%7D
This post passes no rules.
(12-06-2017, 07:57 AM)a52 Wrote: »(12-06-2017, 07:53 AM)a52 Wrote: »i'm certain i must have made a mistake in there somewhere.
...especially since that right side is definitely supposed to be moving to the right
This post passes rules 2 and 3.
(12-06-2017, 08:17 AM)Dragon Fogel Wrote: »So the thing I've noticed regarding Rule 5 is that changes to the sentence continue passing Rule 5 if the number of vowels and consonants remains the same.
I'm not sure which category "y" is in. Let's find out!
This post passes rule 2 and 3.
(12-06-2017, 08:18 AM)Dragon Fogel Wrote: »loam I'm interested in the evens.
This post passes rule 5.
(12-06-2017, 08:18 AM)Dragon Fogel Wrote: »lint I'm interested in the evens.
This post passes rule 2.
(12-06-2017, 09:59 AM)a52 Wrote: »that's better.
https://anvaka.github.io/fieldplay/?dt=0...D&pc=10000
This post passes rule 2.
(12-06-2017, 10:07 AM)a52 Wrote: »(this is what the refrance: https://math.stackexchange.com/questions...a-function)
This post passes rules 2 and 3.