((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/parametric-curve" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.") (tags "egg")) (section 2 "Parametric curve" (p "The " (tt "parametric-curve") " library provides an implementation of parametric curves.  Parametric curves are n-dimensional curves described by parametric equations, one per each dimension. For example:") (pre " x = a cos (t)\n y = a sin (t)\n z = bt") (p "In this example, " (tt "t") " is the parameter, and " (tt "a") " and " (tt "b") " are constants.") (toc)) (section 2 "Usage" (p "(require-extension parametric-curve)")) (section 2 "Documentation" (section 3 "Procedures" (def (sig (procedure "parametric-curve? :: OBJECT -> BOOL" (id parametric-curve?))) (p "Returns " (tt "#t") " if the given object is a parametric curve, " (tt "#f") " otherwise.")) (def (sig (procedure " simple-curve :: N * K * FS * TMIN * TMAX -> PCURVE " (id simple-curve))) (p "Basic parametric curve constructor.") (dl (dt (tt "N")) (dd "number of interpolation points (N >= 3)") (dt (tt "K")) (dd "continuity class of the interpolating spline for this curve (1 or 2, for first or second derivative)") (dt (tt "FS")) (dd "a list of one-argument procedures that are evaluated to obtain points on the curve. The length of " (tt "FS") " determines the dimensionality of the curve") (dt (tt "TMIN")) (dd "minimum value for the curve parameter ") (dt (tt "TMIN")) (dd "maximum value for the curve parameter "))) (def (sig (procedure " sample-curve :: PCURVE -> (T -> POINT) " (id sample-curve))) (p "Constructs a procedure to sample the curve at the given parameter value.")) (def (sig (procedure " sample-curve* :: PCURVE -> (T LIST -> POINT LIST) " (id sample-curve*))) (p "Constructs a procedure to sample the curve at the given parameter values.")) (def (sig (procedure " linear-curve :: N * COEFFS * TMIN * TMAX -> PCURVE " (id linear-curve))) (p "Constructor for a linear curve of the form " (tt "c1 * x + c2") ".") (dl (dt (tt "N")) (dd "number of interpolation points (N >= 3)") (dt (tt "COEFFS")) (dd "supplies c1 and c2 for the different dimensions") (dt (tt "TMIN")) (dd "minimum value for the curve parameter ") (dt (tt "TMAX")) (dd "maximum value for the curve parameter "))) (def (sig (procedure " line-segment:: N * COEFFS -> PCURVE  " (id line-segment))) (p "Creates a line segment whose starting point is zero, and its end points is defined by " (tt "COEFFS") ". " (tt "N") " is the number of interpolating points.")) (def (sig (procedure " map-curve :: FS * PCURVE -> PCURVE " (id map-curve))) (p "Maps the given functions to the parametric curve.")) (def (sig (procedure " iterate-curve :: PCURVE * N -> POINT LIST " (id iterate-curve))) (p "Samples a parametric curve at " (tt "N") " regular intervals in the range " (tt "xmin..xmax") " inclusive.")) (def (sig (procedure " range-curve :: PCURVE * N * (X1,XN) LIST -> POINT LIST " (id range-curve))) (p "Samples a parametric curve at regular intervals in the given ranges.")) (def (sig (procedure " arc-length :: PCURVE * DX -> NUMBER " (id arc-length))) (p "Computers the arc length of the curve given step DX.")))) (section 2 "Examples") (section 2 "About this egg" (section 3 "Author" (p (int-link "/users/ivan-raikov" "Ivan Raikov") ".")) (section 3 "Version history" (dl (dt "1.13") (dd "Added matchable as a test dependency [reported by mario]") (dt "1.7") (dd "Added arc-length") (dt "1.4") (dd "Added line-segment") (dt "1.0") (dd "Initial release"))) (section 3 "License" (pre "Copyright 2012-2015 Ivan Raikov\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or (at\nyour option) any later version.\n\nThis program is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\nGeneral Public License for more details.\n\nA full copy of the GPL license can be found at\n<http://www.gnu.org/licenses/>."))))