Home My Page Projects Code Snippets Project Openings diderot
 Summary Activity Tracker Tasks SCM

# SCM Repository

[diderot] Diff of /branches/lamont/test/implicit-surface/unit-circle.diderot
 [diderot] / branches / lamont / test / implicit-surface / unit-circle.diderot

# Diff of /branches/lamont/test/implicit-surface/unit-circle.diderot

revision 2224, Thu Feb 28 05:06:21 2013 UTC revision 2225, Thu Feb 28 05:14:28 2013 UTC
# Line 8  Line 8
8  input real d = 0.16;  // desired difference of radius (d < r && d > 0)  input real d = 0.16;  // desired difference of radius (d < r && d > 0)
9  input real R = 0.15;  // neighbor radius  input real R = 0.15;  // neighbor radius
10  real MAX_FORCE = 2;  real MAX_FORCE = 2;
11  input real h = 0.009;  // integration step size to control how quickly iterations change position.  input real h = 0.09;  // integration step size to control how quickly iterations change position.
12  input int maxi = 1000; // maximum number of steps in the program  input int maxi = 1000; // maximum number of steps in the program
13  vec4 qWinDim = [-1,1,-1,1]; // i.e. [XMIN, XMAX, YMIN, YMAX]  (required for the query function)  vec4 qWinDim = [-1,1,-1,1]; // i.e. [XMIN, XMAX, YMIN, YMAX]  (required for the query function)
14  vec2 qGridDim = [12,12];  // how many grid cells you want in each direction for the uniform grid (required for the query function)  vec2 qGridDim = [12,12];  // how many grid cells you want in each direction for the uniform grid (required for the query function)
# Line 18  Line 18
18  strand Particle (int i, real posx, real posy) {  strand Particle (int i, real posx, real posy) {
19      vec2 pos = [posx,posy];      vec2 pos = [posx,posy];
20      output vec2 outPos  = pos;      output vec2 outPos  = pos;
21      int strandIdent = i;      int id = i;
22      update {      update {
23
24          vec2 energy =[0.0,0.0];          vec2 energy =[0.0,0.0];
# Line 36  Line 36
36          real angle = 0.0;          real angle = 0.0;
37
38          //Looking at how strand #0 changes for 30 iterations.          //Looking at how strand #0 changes for 30 iterations.
39          /*if(strandIdent == 0) {          /*if(id == 0) {
40             print("pos before = ", pos, "\n");             print("pos before = ", pos, "\n");
41             print("force = ", force, "\n");             print("force = ", force, "\n");
42             angle = atan2(pos[1],pos[0])* 180/π;             angle = atan2(pos[1],pos[0])* 180/π;
# Line 57  Line 57
57          pos += force;          pos += force;
58          pos = normalize(pos);          pos = normalize(pos);
59
60        /*  if(strandIdent == 0) {         /* if(id == 0) {
61             print("new pos = ", pos, "\n");             print("new pos = ", pos, "\n");
62             angle = atan2(pos[1],pos[0])* 180/π;             angle = atan2(pos[1],pos[0])* 180/π;
63             angle = (angle + 360) if angle < 0 else angle;             angle = (angle + 360) if angle < 0 else angle;

Legend:
 Removed from v.2224 changed lines Added in v.2225

 root@smlnj-gforge.cs.uchicago.edu ViewVC Help Powered by ViewVC 1.0.0