               :radius PApplet/RADIUS})
 
 #+clj
-(defn
-  ^{:requires-bindings true
-    :processing-name "rectMode()"
-    :category "Shape"
-    :subcategory "Attributes"
-    :added "1.0"}
-  rect-mode
-  "Modifies the location from which rectangles draw. The default mode
-  is :corner. Available modes are:
-
-
-  :corner  - Specifies the location to be the upper left corner of the
-             shape and uses the third and fourth parameters of rect to
-             specify the width and height.
-
-  :corners - Uses the first and second parameters of rect to set the
-             location of one corner and uses the third and fourth
-             parameters to set the opposite corner.
-
-  :center  - Draws the image from its center point and uses the third
-             and forth parameters of rect to specify the image's width
-             and height.
-
-  :radius  - Draws the image from its center point and uses the third
-             and forth parameters of rect() to specify half of the
-             image's width and height."
-
-  [mode]
-  (let [mode (resolve-constant-key mode rect-modes)]
-    (.rectMode (current-graphics) (int mode))))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "red()"
-    :category "Color"
-    :subcategory "Creating & Reading"
-    :added "1.0"}
-  red
-  "Extracts the red value from a color, scaled to match current color-mode."
-  [c]
-  (.red (current-graphics) (int c)))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "redraw()"
-    :category "Structure"
-    :subcategory nil
-    :added "1.0"}
-  redraw
-  "Executes the code within the draw fn one time. This functions
-  allows the program to update the display window only when necessary,
-  for example when an event registered by mouse-pressed or
-  key-pressed occurs.
-
-  In structuring a program, it only makes sense to call redraw
-  within events such as mouse-pressed. This is because redraw does
-  not run draw immediately (it only sets a flag that indicates an
-  update is needed).
-
-  Calling redraw within draw has no effect because draw is
-  continuously called anyway."
-  []
-  (.redraw (current-applet)))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "requestImage()"
-    :category "Image"
-    :subcategory "Loading & Displaying"
-    :added "1.0"}
-  request-image
-  "This function load images on a separate thread so that your sketch
-  does not freeze while images load during setup. While the image is
-  loading, its width and height will be 0. If an error occurs while
-  loading the image, its width and height will be set to -1. You'll
-  know when the image has loaded properly because its width and height
-  will be greater than 0. Asynchronous image loading (particularly
-  when downloading from a server) can dramatically improve
-  performance."
-  [filename] (.requestImage (current-applet) (str filename)))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "resetMatrix()"
-    :category "Transform"
-    :subcategory nil
-    :added "1.0"}
-  reset-matrix
-  "Replaces the current matrix with the identity matrix. The
-  equivalent function in OpenGL is glLoadIdentity()"
-  []
-  (.resetMatrix (current-graphics)))
-
-#+clj
-(def ^{:private true}
-     shader-modes {:points PApplet/POINTS
-                   :lines PApplet/LINES
-                   :triangles PApplet/TRIANGLES})
-
-#+clj
-(defn
-  ^{:requires-bindings true
-    :processing-name "resetShader()"
-    :category "Rendering"
-    :subcategory "Shaders"
-    :added "2.0"}
-  reset-shader
-  "Restores the default shaders. Code that runs after (reset-shader) will
-  not be affected by previously defined shaders. Optional 'kind' parameter -
-  type of shader, either :points, :lines, or :triangles"
-  ([] (.resetShader (current-graphics)))
-  ([kind]
-    (let [mode (resolve-constant-key kind shader-modes)]
-      (.resetShader (current-graphics) mode))))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "rotate()"
-    :category "Transform"
-    :subcategory nil
-    :added "1.0"}
-  rotate
-  "Rotates a shape the amount specified by the angle parameter. Angles
-  should be specified in radians (values from 0 to TWO-PI) or
-  converted to radians with the radians function.
-
-  Objects are always rotated around their relative position to the
-  origin and positive numbers rotate objects in a clockwise
-  direction. Transformations apply to everything that happens after
-  and subsequent calls to the function accumulates the effect. For
-  example, calling (rotate HALF-PI) and then (rotate HALF-PI) is the
-  same as (rotate PI). All tranformations are reset when draw begins
-  again.
-
-  Technically, rotate multiplies the current transformation matrix by
-  a rotation matrix. This function can be further controlled by the
-  push-matrix and pop-matrix."
-  ([angle] (.rotate (current-graphics) (float angle)))
-  ([angle vx vy vz] (.rotate (current-graphics) (float angle)
-                             (float vx) (float vy) (float vz))))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "rotateX()"
-    :category "Transform"
-    :subcategory nil
-    :added "1.0"}
-  rotate-x
-  "Rotates a shape around the x-axis the amount specified by the angle
-  parameter. Angles should be specified in radians (values from 0 to
-  (* PI 2)) or converted to radians with the radians function. Objects
-  are always rotated around their relative position to the origin and
-  positive numbers rotate objects in a counterclockwise
-  direction. Transformations apply to everything that happens after
-  and subsequent calls to the function accumulates the effect. For
-  example, calling (rotate-x HALF-PI) and then (rotate-x HALF-PI) is
-  the same as (rotate-x PI). If rotate-x is called within the draw fn,
-  the transformation is reset when the loop begins again. This
-  function requires either the :p3d or :opengl renderer."
-  [angle]
-  (.rotateX (current-graphics) (float angle)))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "rotateY()"
-    :category "Transform"
-    :subcategory nil
-    :added "1.0"}
-  rotate-y
-  "Rotates a shape around the y-axis the amount specified by the angle
-  parameter. Angles should be specified in radians (values from 0
-  to (* PI 2)) or converted to radians with the radians function.
-  Objects are always rotated around their relative position to the
-  origin and positive numbers rotate objects in a counterclockwise
-  direction. Transformations apply to everything that happens after
-  and subsequent calls to the function accumulates the effect. For
-  example, calling (rotate-y HALF-PI) and then (rotate-y HALF-PI) is
-  the same as (rotate-y PI). If rotate-y is called within the draw fn,
-  the transformation is reset when the loop begins again. This
-  function requires either the :p3d or :opengl renderer."
-  [angle]
-  (.rotateY (current-graphics) (float angle)))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "rotateZ()"
-    :category "Transform"
-    :subcategory nil
-    :added "1.0"}
-  rotate-z
-  "Rotates a shape around the z-axis the amount specified by the angle
-  parameter. Angles should be specified in radians (values from 0
-  to (* PI 2)) or converted to radians with the radians function.
-  Objects are always rotated around their relative position to the
-  origin and positive numbers rotate objects in a counterclockwise
-  direction. Transformations apply to everything that happens after
-  and subsequent calls to the function accumulates the effect. For
-  example, calling (rotate-z HALF-PI) and then (rotate-z HALF-PI) is
-  the same as (rotate-z PI). If rotate-y is called within the draw fn,
-  the transformation is reset when the loop begins again. This
-  function requires either the :p3d or :opengl renderer."
-  [angle]
-  (.rotateZ (current-graphics) (float angle)))
-
-#+clj
-(defn
-  ^{:requires-bindings false
-    :processing-name "round()"
-    :category "Math"
-    :subcategory "Calculation"
-    :added "1.0"}
-  round
-  "Calculates the integer closest to the value parameter. For example,
-  (round 9.2) returns the value 9."
-  [val]
-  (PApplet/round (float val)))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "saturation()"
-    :category "Color"
-    :subcategory "Creating & Reading"
-    :added "1.0"}
-  saturation
-  "Extracts the saturation value from a color."
-  [c]
-  (.saturation (current-graphics) (int c)))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "save()"
-    :category "Output"
-    :subcategory "Image"
-    :added "1.0"}
-  save
-  "Saves an image from the display window. Images are saved in TIFF,
-  TARGA, JPEG, and PNG format depending on the extension within the
-  filename parameter. For example, image.tif will have a TIFF image
-  and image.png will save a PNG image. If no extension is included in
-  the filename, the image will save in TIFF format and .tif will be
-  added to the name. All images saved from the main drawing window
-  will be opaque. To save images without a background, use
-  create-graphics."
-  [filename]
-  (.save (current-graphics) (str filename)))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "saveFrame()"
-    :category "Output"
-    :subcategory "Image"
-    :added "1.0"}
-  save-frame
-  "Saves an image identical to the current display window as a
-  file. May be called multple times - each file saved will have a
-  unique name. Name and image formate may be modified by passing a
-  string parameter of the form \"foo-####.ext\" where foo- can be any
-  arbitrary string, #### will be replaced with the current frame id
-  and .ext is one of .tiff, .targa, .png, .jpeg or .jpg
-
-  Examples:
-  (save-frame)
-  (save-frame \"pretty-pic-####.jpg\")"
-  ([] (.saveFrame (current-applet)))
-  ([name] (.saveFrame (current-applet) (str name))))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "scale()"
-    :category "Transform"
-    :subcategory nil
-    :added "1.0"}
-  scale
-  "Increases or decreases the size of a shape by expanding and
-  contracting vertices. Objects always scale from their relative
-  origin to the coordinate system. Scale values are specified as
-  decimal percentages. For example, the function call (scale 2)
-  increases the dimension of a shape by 200%. Transformations apply to
-  everything that happens after and subsequent calls to the function
-  multiply the effect. For example, calling (scale 2) and then
-  (scale 1.5) is the same as (scale 3). If scale is called within
-  draw, the transformation is reset when the loop begins again. Using
-  this fuction with the z parameter requires specfying :p3d or :opengl
-  as the renderer. This function can be further controlled by
-  push-matrix and pop-matrix."
-  ([s] (.scale (current-graphics) (float s)))
-  ([sx sy] (.scale (current-graphics) (float sx) (float sy)))
-  ([sx sy sz] (.scale (current-graphics) (float sx) (float sy) (float sz))))
-
-#+clj
-(defn- ^java.awt.Dimension current-screen
-  []
-  (let [default-toolkit (java.awt.Toolkit/getDefaultToolkit)]
-    (.getScreenSize default-toolkit)))
-
-#+clj
-(def ^{:private true} orig-screen-width
-  (let [screen (current-screen)]
-    (.width screen)))
-
-#+clj
-(defn
-  ^{:requires-bindings false
-    :processing-name "screen.width"
-    :category "Environment"
-    :subcategory nil
-    :added "1.0"}
-  screen-width
-  "Returns the width of the main screen in pixels."
-  []
-  orig-screen-width)
-
-#+clj
-(def ^{:private true} orig-screen-height
-  (let [screen (current-screen)]
-    (.height screen)))
-
-#+clj
-(defn
-  ^{:requires-bindings false
-    :processing-name "screen.height"
-    :category "Environment"
-    :subcategory nil
-    :added "1.0"}
-  screen-height
-  "Returns the height of the main screen in pixels."
-  []
-  orig-screen-height)
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "screenX()"
-    :category "Lights, Camera"
-    :subcategory "Coordinates"
-    :added "1.0"}
-  screen-x
-  "Takes a three-dimensional x, y, z position and returns the x value
-  for where it will appear on a (two-dimensional) screen, once
-  affected by translate, scale or any other transformations"
-  ([x y]  (.screenX (current-graphics) (float x) (float y)))
-  ([x y z]  (.screenX (current-graphics) (float x) (float y) (float z))))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "screenY()"
-    :category "Lights, Camera"
-    :subcategory "Coordinates"
-    :added "1.0"}
-  screen-y
-  "Takes a three-dimensional x, y, z position and returns the y value
-  for where it will appear on a (two-dimensional) screen, once
-  affected by translate, scale or any other transformations"
-  ([x y]  (.screenY (current-graphics) (float x) (float y)))
-  ([x y z]  (.screenY (current-graphics) (float x) (float y) (float z))))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "screenZ()"
-    :category "Lights, Camera"
-    :subcategory "Coordinates"
-    :added "1.0"}
-  screen-z
-  "Given an x, y, z coordinate, returns its z value.
-   This value can be used to determine if an x, y, z coordinate is in
-   front or in back of another (x, y, z) coordinate. The units are
-   based on how the zbuffer is set up, and don't relate to anything
-   'real'. They're only useful for in comparison to another value
-   obtained from screen-z, or directly out of the zbuffer"
-  [x y z]
-  (.screenZ (current-graphics) (float x) (float y) (float z)))
-
-#+clj
-(defn
-  ^{:requires-bindings false
-    :processing-name "second()"
-    :category "Input"
-    :subcategory "Time & Date"
-    :added "1.0"}
-  seconds
-  "Returns the current second as a value from 0 - 59."
-  []
-  (PApplet/second))
-
-#+clj
-(defn
-  ^{:requires-bindings true
-    :processing-name "set()"
-    :category "Image"
-    :subcategory "Pixels"
-    :added "1.0"}
-  set-pixel
-  "Changes the color of any pixel in the display window. The x and y
-  parameters specify the pixel to change and the color parameter
-  specifies the color value. The color parameter is affected by the
-  current color mode (the default is RGB values from 0 to 255).
-
-  Setting the color of a single pixel with (set x, y) is easy, but not
-  as fast as putting the data directly into pixels[].
-
-  This function ignores imageMode().
-
-  Due to what appears to be a bug in Apple's Java implementation, the
-  point() and set() methods are extremely slow in some circumstances
-  when used with the default renderer. Using :p2d or :p3d will fix the
-  problem. Grouping many calls to point or set-pixel together can also
-  help. (Bug 1094)"
-  ([x y c] (set-pixel (current-graphics) x y c))
-  ([^PImage img x y c]
-    (.set img (int x) (int y) (int c))))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "set()"
-    :category "Image"
-    :subcategory "Pixels"
-    :added "1.0"}
-  set-image
-  "Writes an image directly into the display window. The x and y
-  parameters define the coordinates for the upper-left corner of the
-  image."
-  [x y ^PImage src]
-  (.set (current-graphics) (int x) (int y) src))
-
-#+clj
-(defn
-  ^{:requires-bindings true
-    :processing-name "shader()"
-    :category "Rendering"
-    :subcategory "Shaders"
-    :added "2.0"}
-  shader
-  "Applies the shader specified by the parameters. It's compatible with the :p2d
-  and :p3drenderers, but not with the default :java2d renderer. Optional 'kind'
-  parameter - type of shader, either :points, :lines, or :triangles"
-  ([shader] (.shader (current-graphics) shader))
-  ([shader kind]
-    (let [mode (resolve-constant-key kind shader-modes)]
-      (.shader (current-graphics) shader mode))))
-
-#+clj
-(defn
-  ^{:requires-bindings true
-    :processing-name "shape()"
-    :category "Shape"
-    :subcategory "Loading & Displaying"
-    :added "1.0"}
-  shape
-  "Displays shapes to the screen. The shapes must have been loaded
-  with load-shape. Processing currently works with SVG shapes
-  only. The sh parameter specifies the shape to display and the x and
-  y parameters define the location of the shape from its upper-left
-  corner. The shape is displayed at its original size unless the width
-  and height parameters specify a different size. The shape-mode
-  fn changes the way the parameters work. A call to
-  (shape-mode :corners), for example, will change the width and height
-  parameters to define the x and y values of the opposite corner of
-  the shape.
-
-  Note complex shapes may draw awkwardly with the renderers :p2d, :p3d, and
-  :opengl. Those renderers do not yet support shapes that have holes
-  or complicated breaks."
-  ([^PShape sh] (.shape (current-graphics) sh))
-  ([^PShape sh x y] (.shape (current-graphics) sh (float x) (float y)))
-  ([^PShape sh x y width height] (.shape (current-graphics) sh (float x) (float y) (float width) (float height))))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "shearX()"
-    :category "Transform"
-    :subcategory nil
-    :added "1.0"}
-  shear-x
-  "Shears a shape around the x-axis the amount specified by the angle
-  parameter. Angles should be specified in radians (values from 0 to
-  PI*2) or converted to radians with the radians() function. Objects
-  are always sheared around their relative position to the origin and
-  positive numbers shear objects in a clockwise direction.
-  Transformations apply to everything that happens after and
-  subsequent calls to the function accumulates the effect. For
-  example, calling (shear-x (/ PI 2)) and then (shear-x (/ PI 2)) is
-  the same as (shear-x PI). If shear-x is called within the draw fn,
-  the transformation is reset when the loop begins again. This
-  function works in P2D or JAVA2D mode.
-
-  Technically, shear-x multiplies the current transformation matrix
-  by a rotation matrix. This function can be further controlled by the
-  push-matrix and pop-matrix fns."
-  [angle]
-  (.shearX (current-graphics) (float angle)))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "shearY()"
-    :category "Transform"
-    :subcategory nil
-    :added "1.0"}
-  shear-y
-  "Shears a shape around the y-axis the amount specified by the angle
-  parameter. Angles should be specified in radians (values from 0 to
-  PI*2) or converted to radians with the radians() function. Objects
-  are always sheared around their relative position to the origin and
-  positive numbers shear objects in a clockwise direction.
-  Transformations apply to everything that happens after and
-  subsequent calls to the function accumulates the effect. For
-  example, calling (shear-y (/ PI 2)) and then (shear-y (/ PI 2)) is
-  the same as (shear-y PI). If shear-y is called within the draw fn,
-  the transformation is reset when the loop begins again. This
-  function works in P2D or JAVA2D mode.
-
-  Technically, shear-y multiplies the current transformation matrix
-  by a rotation matrix. This function can be further controlled by the
-  push-matrix and pop-matrix fns."
-  [angle]
-  (.shearY (current-graphics) (float angle)))
-
-#+clj
 (def ^{:private true}
   p-shape-modes {:corner PApplet/CORNER
                  :corners PApplet/CORNERS
                  :center PApplet/CENTER})
-
-#+clj
-(defn ^{:requires-bindings true
-        :processing-name "shapeMode()"
-        :category "Shape"
-        :subcategory "Loading & Displaying"
-        :added "1.0"}
-  shape-mode
-  "Modifies the location from which shapes draw. Available modes are
-  :corner, :corners and :center. Default is :corner.
-
-  :corner  - specifies the location to be the upper left corner of the
-             shape and uses the third and fourth parameters of shape
-             to specify the width and height.
-
-  :corners - uses the first and second parameters of shape to set
-             the location of one corner and uses the third and fourth
-             parameters to set the opposite corner.
-
-  :center  - draws the shape from its center point and uses the third
-             and forth parameters of shape to specify the width and
-             height. "
-  [mode]
-  (let [mode (resolve-constant-key mode p-shape-modes)]
-    (.shapeMode (current-graphics) (int mode))))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "shininess()"
-    :category "Lights, Camera"
-    :subcategory "Material Properties"
-    :added "1.0"}
-  shininess
-  "Sets the amount of gloss in the surface of shapes. Used in
-  combination with ambient, specular, and emissive in setting
-  the material properties of shapes."
-  [shine]
-  (.shininess (current-graphics) (float shine)))
-
-#+clj
-(defn
-  ^{:requires-bindings false
-    :processing-name "sin()"
-    :category "Math"
-    :subcategory "Trigonometry"
-    :added "1.0"}
-  sin
-  "Calculates the sine of an angle. This function expects the values
-  of the angle parameter to be provided in radians (values from 0 to
-  6.28). A float within the range -1 to 1 is returned."
-  [angle]
-  (PApplet/sin (float angle)))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "smooth()"
-    :category "Shape"
-    :subcategory "Attributes"
-    :added "1.0"}
-  smooth
-  "Draws all geometry with smooth (anti-aliased) edges. This will slow
-  down the frame rate of the application, but will enhance the visual
-  refinement.
-
-  The level parameter (int) increases the level of smoothness with the P2D and P3D
-  renderers. This is the level of over sampling applied to the graphics buffer.
-  The value '2' will double the rendering size before scaling it down to the
-  display size. This is called '2x anti-aliasing.' The value 4 is used for 4x
-  anti-aliasing and 8 is specified for 8x anti-aliasing. If level is set to 0,
-  it will disable all smoothing; it's the equivalent of the function noSmooth().
-  The maximum anti-aliasing level is determined by the hardware of the machine
-  that is running the software.
-
-  Note that smooth will also improve image quality of resized images."
-  ([] (.smooth (current-graphics)))
-  ([level] (.smooth (current-graphics) (int level))))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "specular()"
-    :category "Lights, Camera"
-    :subcategory "Material Properties"
-    :added "1.0"}
-  specular
-  "Sets the specular color of the materials used for shapes drawn to
-  the screen, which sets the color of hightlights. Specular refers to
-  light which bounces off a surface in a perferred direction (rather
-  than bouncing in all directions like a diffuse light). Used in
-  combination with emissive, ambient, and shininess in setting
-  the material properties of shapes."
-  ([gray] (.specular (current-graphics) (float gray)))
-  ([x y z] (.specular (current-graphics) (float x) (float y) (float z))))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "sphere()"
-    :category "Shape"
-    :subcategory "3D Primitives"
-    :added "1.0"}
-  sphere
-  "Generates a hollow ball made from tessellated triangles."
-  [radius] (.sphere (current-graphics) (float radius)))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "sphereDetail()"
-    :category "Shape"
-    :subcategory "3D Primitives"
-    :added "1.0"}
-  sphere-detail
-  "Controls the detail used to render a sphere by adjusting the number
-  of vertices of the sphere mesh. The default resolution is 30, which
-  creates a fairly detailed sphere definition with vertices every
-  360/30 = 12 degrees. If you're going to render a great number of
-  spheres per frame, it is advised to reduce the level of detail using
-  this function. The setting stays active until sphere-detail is
-  called again with a new parameter and so should not be called prior
-  to every sphere statement, unless you wish to render spheres with
-  different settings, e.g. using less detail for smaller spheres or
-  ones further away from the camera. To controla the detail of the
-  horizontal and vertical resolution independently, use the version of
-  the functions with two parameters."
-  ([res] (.sphereDetail (current-graphics) (int res)))
-  ([ures vres] (.sphereDetail (current-graphics) (int ures) (int vres))))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "spotLight()"
-    :category "Lights, Camera"
-    :subcategory "Lights"
-    :added "1.0"}
-  spot-light
-  "Adds a spot light. Lights need to be included in the draw to
-  remain persistent in a looping program. Placing them in the setup
-  of a looping program will cause them to only have an effect the
-  first time through the loop. The affect of the r, g, and b
-  parameters is determined by the current color mode. The x, y, and z
-  parameters specify the position of the light and nx, ny, nz specify
-  the direction or light. The angle parameter affects angle of the
-  spotlight cone."
-  ([r g b x y z nx ny nz angle concentration]
-     (.spotLight (current-graphics) r g b x y z nx ny nz angle concentration))
-  ([[r g b] [x y z] [nx ny nz] angle concentration]
-     (.spotLight (current-graphics) r g b x y z nx ny nz angle concentration)))
-
-#+clj
-(defn
-  ^{:requires-bindings false
-    :processing-name "sq()"
-    :category "Math"
-    :subcategory "Calculation"
-    :added "1.0"}
-  sq
-  "Squares a number (multiplies a number by itself). The result is
-  always a positive number, as multiplying two negative numbers always
-  yields a positive result. For example, -1 * -1 = 1."
-  [a]
-  (PApplet/sq (float a)))
-
-#+clj
-(defn
-  ^{:requires-bindings false
-    :processing-name "sqrt()"
-    :category "Math"
-    :subcategory "Calculation"
-    :added "1.0"}
-  sqrt
-  "Calculates the square root of a number. The square root of a number
-  is always positive, even though there may be a valid negative
-  root. The square root s of number a is such that (= a (* s s)) . It
-  is the opposite of squaring."
-  [a]
-  (PApplet/sqrt (float a)))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "loop()"
-    :category "Structure"
-    :subcategory nil
-    :added "1.0"}
-  start-loop
-  "Causes Processing to continuously execute the code within
-  draw. If no-loop is called, the code in draw stops executing."
-  []
-  (.loop (current-applet)))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "stroke()"
-    :category "Color"
-    :subcategory "Setting"
-    :added "1.0"}
-  stroke-float
-  "Sets the color used to draw lines and borders around
-  shapes. Converts all args to floats"
-  ([gray] (.stroke (current-graphics) (float gray)))
-  ([gray alpha] (.stroke (current-graphics) (float gray) (float alpha)))
-  ([x y z] (.stroke (current-graphics) (float x) (float y) (float z)))
-  ([x y z a] (.stroke (current-graphics) (float x) (float y) (float z) (float a))))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "stroke()"
-    :category "Color"
-    :subcategory "Setting"
-    :added "1.0"}
-  stroke-int
-  "Sets the color used to draw lines and borders around
-  shapes. Converts rgb to int and alpha to a float."
-  ([rgb] (.stroke (current-graphics) (int rgb)))
-  ([rgb alpha] (.stroke (current-graphics) (int rgb) (float alpha))))
-
-(defn
-  ^{:requires-bindings true
-    :processing-name "stroke()"
-    :category "Color"
-    :subcategory "Setting"
-    :added "1.0"}
-  stroke
-  "Sets the color used to draw lines and borders around shapes. This
-  color is either specified in terms of the RGB or HSB color depending
-  on the current color-mode (the default color space is RGB, with
-  each value in the range from 0 to 255)."
-  #+clj ([rgb] (if (int-like? rgb) (stroke-int rgb) (stroke-float rgb)))
-  #+clj ([rgb alpha] (if (int-like? rgb) (stroke-int rgb alpha) (stroke-float rgb alpha)))
-  ([x y z] (stroke-float x y z))
-  ([x y z a] (stroke-float x y z a)))
 
 #+clj
 (def ^{:private true}

                    :model PApplet/MODEL})

#+clj
(defn
  ^{:requires-bindings true
    :processing-name "strokeCap()"
    :category "Shape"
    :subcategory "Attributes"
    :added "1.0"}
  stroke-cap
  "Sets the style for rendering line endings. These ends are either
  squared, extended, or rounded and specified with the corresponding
  parameters :square, :project, and :round. The default cap is :round."
  [cap-mode]
  (let [cap-mode (resolve-constant-key cap-mode stroke-cap-modes)]
    (.strokeCap (current-graphics) (int cap-mode))))

#+clj
(def ^{:private true}
  stroke-join-modes {:miter PConstants/MITER
                     :bevel PConstants/BEVEL
                     :round PConstants/ROUND})

#+clj
(defn
  ^{:requires-bindings true
    :processing-name "strokeJoin()"
    :category "Shape"
    :subcategory "Attributes"
    :added "1.0"}
  stroke-join
  "Sets the style of the joints which connect line
  segments. These joints are either mitered, beveled, or rounded and
  specified with the corresponding parameters :miter, :bevel, and
  :round. The default joint is :miter.

  This function is not available with the :p2d, :p3d, or :opengl
  renderers."
  [join-mode]
  (let [join-mode (resolve-constant-key join-mode stroke-join-modes)]
    (.strokeJoin (current-graphics) (int join-mode))))

(defn
  ^{:requires-bindings true
    :processing-name "strokeWeight()"
    :category "Shape"
    :subcategory "Attributes"
    :added "1.0"}
  stroke-weight
  "Sets the width of the stroke used for lines, points, and the border
  around shapes. All widths are set in units of pixels. "
  [weight]
  (.strokeWeight (current-graphics) (float weight)))

#+clj
(defn
  ^{:requires-bindings false
    :processing-name "tan()"
    :category "Math"
    :subcategory "Trigonometry"
    :added "1.0"}
  tan
  "Calculates the ratio of the sine and cosine of an angle. This
  function expects the values of the angle parameter to be provided in
  radians (values from 0 to PI*2). Values are returned in the range
  infinity to -infinity."
  [angle]
  (PApplet/tan (float angle)))

#+clj
(defn
  ^{:requires-bindings true
    :category "Environment"
    :subcategory nil
    :added "1.5.0"}
  target-frame-rate
  "Returns the target framerate specified with the fn frame-rate"
  []
  @(quil.applet/target-frame-rate))

(defn
  ^{:requires-bindings true
    :processing-name "text()"
    :category "Typography"
    :subcategory "Loading & Displaying"
    :added "1.0"}
  text-char
  "Draws a char to the screen in the specified position. See text fn
  for more details."
  ([c x y] (.text (current-graphics) (char c) (float x) (float y)))
  ([c x y z] (.text (current-graphics) (char c) (float x) (float y) (float z))))

(defn
  ^{:requires-bindings true
    :processing-name "text()"
    :category "Typography"
    :subcategory "Loading & Displaying"
    :added "1.0"}
  text-num
  "Draws a number to the screen in the specified position. See text fn
  for more details."
  ([num x y] (.text (current-graphics) (float num) (float x) (float y)))
  ([num x y z] (.text (current-graphics) (float num) (float x) (float y) (float z))))

(defn
  ^{:requires-bindings true
    :processing-name "text()"
    :category "Typography"
    :subcategory "Loading & Displaying"
    :added "1.0"}
  text
  "Draws text to the screen in the position specified by the x and y
  parameters and the optional z parameter. A default font will be used
  unless a font is set with the text-font fn. Change the color of the
  text with the fill fn. The text displays in relation to the
  text-align fn, which gives the option to draw to the left, right, and
  center of the coordinates.

  The x1, y1, x2 and y2 parameters define a
  rectangular area to display within and may only be used with string
  data. For text drawn inside a rectangle, the coordinates are
  interpreted based on the current rect-mode setting."
  ([^String s x y] (.text (current-graphics) s (float x) (float y)))
  ([^String s x y z] (.text (current-graphics) s (float x) (float y) (float z)))
  ([^String s x1 y1 x2 y2] (.text (current-graphics) s (float x1) (float y1) (float x2) (float y2))))

#+clj
(def ^{:private true}

                            :baseline PApplet/BASELINE})

#+clj
(def ^{:private true}
  text-modes {:model PConstants/MODEL
              :shape PConstants/SHAPE})

#+clj
(def ^{:private true}
  texture-modes {:image PApplet/IMAGE
                 :normal PApplet/NORMAL})

#+clj
(def ^{:private true}
  texture-wrap-modes {:clamp PApplet/CLAMP
                      :repeat PApplet/REPEAT})

;;; Useful trig constants
#+clj (def PI  (float Math/PI))
