ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/tabfunc.c
(Generate patch)

Comparing ray/src/cal/tabfunc.c (file contents):
Revision 1.9 by greg, Mon Jun 29 21:25:36 2020 UTC vs.
Revision 1.10 by greg, Thu Mar 18 03:09:34 2021 UTC

# Line 156 | Line 156 | absc_exp(void)                 /* produce expression for abscissa */
156                  printf("X`%s(i):select(i,", locID);
157                  putlist(abscissa, tabsize, 20);
158                  puts(");");
159 <                if (increasing) {
159 >                if (increasing)
160                          printf("fx2`%s(x,i):if(x-X`%s(i),\n", locID, locID);
161 +                else
162 +                        printf("fx2`%s(x,i):if(X`%s(i)-x,\n", locID, locID);
163 +                printf("\ti+(x-X`%s(i))/(X`%s(i+1)-X`%s(i)),\n",
164 +                                locID, locID, locID);
165 +                printf("\tfx2`%s(x,i-1));\n", locID);
166 +                if (increasing)
167                          printf("fx`%s(x):if(x-%g,if(%g-x,fx2`%s(x,%d),%d),1);\n",
168                                          locID, abscissa[0], abscissa[tabsize-1],
169                                          locID, tabsize, tabsize);
170 <                } else {
165 <                        printf("fx2`%s(x,i):if(X`%s(i)-x,\n", locID, locID);
170 >                else
171                          printf("fx`%s(x):if(%g-x,if(x-%g,fx2`%s(x,%d),%d),1);\n",
172                                          locID, abscissa[0], abscissa[tabsize-1],
173                                          locID, tabsize, tabsize);
169                }
170                printf("\ti+(x-X`%s(i))/(X`%s(i+1)-X`%s(i)),\n",
171                                locID, locID, locID);
172                printf("\tfx2`%s(x,i-1));\n", locID);
174                  sprintf(ourexp, "fx`%s(x)", locID);
175          }
176          return(ourexp);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines