// This generates a circle. d = 2. #include #include "l.h" #include bp g2(int vc){R* a = malloc(sizeof(R)*vc*2); short * l = malloc(sizeof(short)*vc*2); R const tpi = 2.*3.1415926535897932385; {int j=vc; while(j--) { a[2*j] = cos(j*tpi/vc); a[2*j+1] = sin(j*tpi/vc); l[2*j] = j; l[2*j+1] = j+1;} l[2*(vc-1)+1] = 0;} return (bp){2, vc, a, vc, l};} static R wh[] = {1, -1}; static short c[] = {0, 1}; bp g1(){return (bp){1, 2, wh, 2, c};} // routine gx returns a zero brane with a boundary. // This is helpful in debugging. bp gx(){return (bp){1, 1, wh+1, 1, c};}