title: How to plot a 3-Dimension graph with Racket
body: <p>I am using Racket and Dr. Racket. There is a great library called plot which allows you to plot graphs in 2D or 3D.</p>
  
  <p>After importing the package:</p>
  
  <pre><code>(require plot)
  </code></pre>
  
  <p>I can plot graphs like <code>f(x,y) = 3 * x</code> with:</p>
  
  <pre><code>(plot3d (surface3d (lambda (x y) (* x 3)) (- 10) 10 (- 10) 10))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/n1iwn.png" rel="nofollow"><img src="https://i.stack.imgur.com/n1iwn.png" alt="enter image description here"></a></p>
  
  <p>However, when I try plotting this equation:</p>
  
  <pre><code>f (x,y,z) = 2(x-2)^2 + (y-1)^2+(z-3)^2 - 10
  
  (plot3d (surface3d (lambda (x y z) (+ (* 2 (expt (- x 2) 2))
                                        (expt (- y 1) 2)
                                        (expt (- z 3) 2)
                                        -10))
                                        (- 10) 10 (- 10) 10))
  </code></pre>
  
  <p>I get a big message of error which I cannot understand:</p>
  
  <pre><code>surface3d: contract violation
    expected: a procedure that accepts 2 non-keyword argument
    given: #&lt;procedure:...top/graficos.rkt:14:19&gt;
    in: the 1st argument of
        (-&gt;*
         ((-&gt; any/c any/c Real))
         ((or/c Real #f)
          (or/c Real #f)
          (or/c Real #f)
          (or/c Real #f)
          #:alpha
          Nonnegative-Real
          #:color
          (or/c
           Integer
           Symbol
           String
           (recursive-contract g147 #:impersonator)
           (cons/c
            Real
            (cons/c Real (cons/c Real '()))))
          #:label
          (or/c #f String)
          #:line-color
          (or/c
           Integer
           Symbol
           String
           (recursive-contract g147 #:impersonator)
           (cons/c
            Real
            (cons/c Real (cons/c Real '()))))
          #:line-style
          (or/c
           Integer
           'transparent
           'solid
           'dot
           'long-dash
           'short-dash
           'dot-dash)
          #:line-width
          Nonnegative-Real
          #:samples
          Positive-Integer
          #:style
          (or/c
           Integer
           'transparent
           'solid
           'bdiagonal-hatch
           'crossdiag-hatch
           'fdiagonal-hatch
           'cross-hatch
           'horizontal-hatch
           'vertical-hatch)
          #:z-max
          (or/c Real #f)
          #:z-min
          (or/c Real #f))
         any)
    contract from: 
        &lt;pkgs&gt;/plot-lib/plot/private/plot3d/surface.rkt
    blaming: /home/pedro/Desktop/graficos.rkt
     (assuming the contract is correct)
    at: &lt;pkgs&gt;/plot-lib/plot/private/plot3d/surface.rkt:49.9
  </code></pre>
  
  <p>It is absolutelly possible to graph this. I did it on Wolfram Alpha:</p>
  
  <p><a href="https://i.stack.imgur.com/idbt4.png" rel="nofollow"><img src="https://i.stack.imgur.com/idbt4.png" alt="enter image description here"></a></p>