anchor.diff:  	results))))
   
   (defmethod getLinearRoot ((p Polynomial))
  +  "Returns the root of a linear polynomial (degree equals one)."
     (let ((results (make-array 3 :element-type 'float :fill-pointer 0))
   	(a (elt (coefs p) 1)))
       (when (/= 0 a)
  
positive.code:     results))
  
  (defmethod getQuadraticRoots ((p Polynomial))
    (let ((results (make-array 3 :element-type 'float :fill-pointer 0)))
      (when (= (degree p) 2)
        (let* ((a (elt (coefs p) 2))
  
negative.code: (in-package #:lindsey)
  
  (defconstant TOLERANCE 1e-6 "TOLERANCE is a number used to determine if a number is close enough to zero to be considered zero.")
  (defconstant ACCURACY 6 "ACCURACY is an integer that is used to determine the minimum number of digits of accuracy to be returned by a result.")
  
  (defclass Polynomial ()
    ((coefs :initarg :coefs
  	  :accessor coefs
  	  :documentation "Each number corresponds to a monomial in the polynomial. The position of the coefficient in the array corresponds to the degree of the monomial to which it belongs.")
     (var   :initarg :var
  	  :accessor var
  	  :initform "t")
     (s     :initarg :s
            :accessor s))
    (:documentation "Polynomial is an object used to manipulate polynomials.
  This object was created to encapsulate root finding functions needed by the intersection methods in the Intersection object.
  
  getCubicRoots\(\) and getQuarticRoots\(\) was derived from David Eberly's excellent game engine source which can be found at his site. If you are at all interested in 3D gaming algorithms, then I highly recommend his \"3D Game Engine Design\" book \(ISBN 1-55860-593-2\)."))
  
  (defmethod init ((p Polynomial) cfs)
    "Initializes all properties for this object.
  
  One or more coefficients initialize the Polynomial.
  The coefficients are in order by highest degree monomial first.
  For example, the following example initializes a Polynomial object for:
  
  3x^4 + 2x^2 + 5:
  
  \(init p 3 0 2 0 5\)
  
  All coefficients from highest degree to degree 0 must be provided.
  A zero is used for monomials that are not present in the polynomial.
  
  NOTE: The polynomial coefficients are stored in an array in the reverse order
  to how they were specified. This has the benefit that the coefficient's position
  in the array corresponds to the degree of the monomial to which it belongs."
    (setf (coefs p) (reverse (copy-seq cfs))))
  
  (defmethod initialize-instance :after ((p Polynomial) &key)
    "Constructor method"
    (init p (coefs p)))
  
  (defmethod evaluate ((p Polynomial) x)
    "Evalutes the polynomial at the specified x value.
  x is a number that is \"plugged into\" the polynomial to evaluate it."
    (assert (numberp x) nil "Polynomial evaluate: parameter must be a number.")
    (let ((result 0))
      (loop for i across (coefs p)
         do (setf result (+ (* result x) i)))
      result))
  
  (defmethod degree ((p Polynomial))
    "Returns the degree of the polynomial represented by the Polynomial object."
    (1- (length (coefs p))))
  
  (defmethod getCubicRoots ((p Polynomial))
    "Returns the roots of a cubic polynomial (degree equals three)."
    (let ((results (make-array 3 :element-type 'float :fill-pointer 0)))
      (when (= 3 (degree p))
        (let* ((c3 (elt (coefs p) 3))
  