📄 errata.graphicsgems
字号:
coeffs[ 0 ] = z - u; coeffs[ 1 ] = q < 0 ? -v : v; coeffs[ 2 ] = 1; num = SolveQuadric(coeffs, s); coeffs[ 0 ]= z + u; coeffs[ 1 ] = q < 0 ? v : -v; coeffs[ 2 ] = 1; The sign of "q" affects the sign of coeffs[1].p. 745, throughout: delete references to "lx", which is set but not usedp. 748, line 22: change "negetive" to "negative"p. 753, line 35: change "int n1, n2," to "int n1=0, n2=0," so that first fprintf() error message has defined valuesp. 756, line 15: "unsigned int *fi=&f;" to "unsigned int *fi = (unsigned int *) &f;" for type consistency, and some compilers think "=&" means "&="p. 766, top: add '#include "GraphicsGems.h"' and '#include <math.h>' line 25: change "det = det4x4( out );" to "det = det4x4( in );" throughout: change "matrix4" to "Matrix4"p. 774, line 5: change "theta," to "theta = 0,"p. 799, line 32: add between first "DrawBezierCurve(...);" call and "return;": free((void *)bezCurve);p. 799, bottom and p. 800, line 11: add this pair of lines between "DrawBezierCurve(...);" and "return;": free((void *)u); free((void *)bezCurve); Also, see errata note at end of this file.p. 800, line 19: add this pair of lines before "tHatCenter = ...": free((void *)u); free((void *)bezCurve);p. 802, line 2: Change " < 0.0" to " < 1.0e-6" in the alpha tests. Otherwise you get coincident control points that lead to divide by zero in any subsequent NewtonRaphsonRootFind() call.Syntax errors (ones your compiler or lint will catch):p. 633-642, throughout: replace "};" with "}" to make lint happyp. 640, gcd(): the variable "k" is set but not used - remove itp. 649, line 31: change "LengthVector3" to "V3Length"p. 650, line 1: bad end-of comment; delete "/"p. 651, throughout: Can't use "const" as a variable name, as it is a reserved word in ANSI C. Use "liconst" instead.p. 657, 659: make "nicenum" declarations match, i.e. use either "double nicenum()" or "static double nicenum()" for both occurrencesp. 659: change "exp" to "expv", since "exp()" is a math library function.p. 660, line 11: header missing end of comment "*/"p. 662, line 13: change "SYBYRES" to "SUBYRES" line 16: bad space after "MODRES" line 42: change "XRmax" to "xRmax"p. 665, line 15: missing semicolon after "int area" line 27: change "O" to "0" in "if (partialArea>O)"p. 666, line 13: change "O" to "0" in "rightMask = O;"p. 670, top: add to make lint happy static scanline(); static incrementalize_y(); static incrementalize_x(); static increment();p. 671, line 35: missing "{" at end of "while (y<ly && y<ry)"p. 671-2, throughout: add "(double *)" castings to all "incrementalize*" calls to make lint happyp. 676, line 8: change "if (tu<=0. ^ tv<=0.) {" to "if ( (tu<=0.) ^ (tv<=0.) ) {" to avoid precedence confusion end: change "void pixelproc();" to "static void pixelproc();"p. 681, throughout: "y0" and "y1" are Bessel functions in the math library, so lint complains; ignore complaint or renamep. 684: change "delete" to "cdelete" and "insert" to "cinsert", since these routine names are already used by dbm database managerp. 687, near end: change "+ =" to "+="p. 696, line 8: add '#include "GraphicsGems.h"'p. 700, line 5: add '#include "GraphicsGems.h"'p. 702-706: change "max" to "MAX", "min" to "MIN"p. 705, line 18: delete "*sp", as it is not usedp. 706, end: add '#include "GraphicsGems.h"'p. 707, in clip: delete "*sp", as it is not usedp. 709, line 23: missing semicolon at end of "up = (up) ? FALSE : TRUE"p. 710, top: change "max" to "MAX", "min" to "MIN"p. 713, line 26: change ":" to ";" in "char **argv:"p. 715, top: pseudo-code at head of file (to advance from one element to the next) should be commented out. line 14: missing declaration "int randmasks[32];" throughout: three calls to "bitwidth()" need to cast argument to "(unsigned int)" to make lint happyp. 719: add "#include <string.h>" (or strings.h)p. 727, line 11: remove ")" in "static double bigC,..." linep. 728, lines 21-23: change "cal_q_msq" to "calc_q_msq" lines 23,42: change "NULL" to "(double *)NULL" to make lint happy line 26: change "con_const" to "cone_const" in "bigC = m1sq + con_const * q1" last line: add a "}" to end albers_project procedurep. 730: missing inclusion of GraphicsGems.h.p. 734, line 4: change "exit();" to "exit(1);"p. 736, line 20: change "O" to "0" in "for (i=O;"p. 739, line 12: change "else if (D > 0)" to "else", since at this point D must be greater than 0; makes lint happyp. 757, line 4: change "{" to "[" in "sqrttab{" line 14: change "= &n" to "= (unsigned int *)&n" line 21: change "*num & = 0x7fffff:" to "*num &= 0x7fffff;" to fit ANSI C, and to fix error of ":" at end of line. line 22: change "| =" to "|=" line 27: change ":" to ";"p. 765, line 20,22: change "Matrix" to "Matrix4"p. 766, line 29: change "exit();" to "exit(1);"p. 774, line 2: missing ";" at end of "long *argx, *argy"p. 775: P, Q, and M need to be declared as externsp. 780, line 18: bad start of comment for "/ re-parameterization"p. 785, line 1: bad start-of-commentp. 789, lines 7,25: change both "NULL" to "(Point2 *)NULL" to make lint happy in ConvertToBezierForm: "t" is not used, can be deletedp. 791, line 24: remove "break;" after "return 0;"; unnecessaryp. 793, ControlPolygonFlatEnough: "t" is not used, can be deletedp. 795, ComputeXIntercept: "T" and "Y" do not have to be computed, since the result "Y" is not returned. Note that there are many operations in this routine that are unnecessary (e.g. "0.0 - 0.0").p. 797-807, throughout: change "V2ScaleII" to "V2ScaleIII" and "Bezier" to "BezierII" in order to avoid name collisions with the code on pages 787-796 (i.e. the same subroutine names are used in both, but with different argument types, etc). Important only if you link in both of these subroutine libraries.-----The following are typographical errors in the comments:p. 687, line 3: "plottted" to "plotted"p. 701, line 26: change "interscetion" to "intersection"p. 723, line 1: "tight" is not used in the strict mathematical sense that the sphere generated is optimal (i.e. no smaller sphere could be found), but rather meaning "near optimal".p. 728, line 10: "latitute" to "latitude"p. 729, line 8: "degress" to "degrees"p. 724, line 38: "seperated" to "separated"p. 725, lines 7-9: "componant" to "component"p. 730, line 17: "minium" to "minimum"p. 752, line 2: "positve" to "positive"p. 760, line 5: "interger" to "integer"p. 761, line 4: "preceed" to "precede"p. 766, throughout (5 times): "determinent" to "determinant"p. 781, lines 7,23: "demoninator" to "denominator"-----Addenda: There is additional code for Kelvin Thompson's "RenderingAnti-Aliased Lines" gem in the online distribution of the code.-----Concerning page 799, Philip Schneider's Bezier code:If you are operating in a dimensional system such that the desired error inthe fitting process is a fraction (e.g., 0.01 inches) rather than a wholenumber (e.g., 2.0 pixels), then the line on page 799 readingiterationError = error * error;should be changed toiterationError = ERRFACTOR * error;where ERRFACTOR is #defined to some implementation-dependent value such as4.0. If this is not done, then reparameterization will never occur. Theresult is not an erroneous curve, but a suboptimal one; the algorithm willalways subdivide when the initial fit is too "loose."(from Earl Boebert, boebert@SCTC.COM)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -