     context.lineTo(@x, @y)
     context.closePath()
 
+  # Pastes the values of the passed-in rectangle into this one.
+  #
+  # x - The x coordinate {Number} of the rectangle or a rectangle-like {Object}.
+  # y - The y coordinate {Number} of the rectangle.
+  # width - The width {Number} of the rectangle.
+  # height - The height {Number} of the rectangle.
+  # rotation - The rotation {Number} of the rectangle.
   paste: (x, y, width, height, rotation) ->
     values = @rectangleFrom x, y, width, height, rotation
     @[k] = parseFloat v for k,v of values when Math.isFloat v
 
+  # Internal: Resets all invalid number in the passed-in array to `0`.
+  #
+  # values - An {Array} containing numeric values.
+  #
+  # Returns an {Array}.
   defaultToZero: (values) ->
     values[k] = 0 for k,v of values when not Math.isFloat v
     values


    p.angle()

  pathSteps: (pathBasedOnLength=true) ->
    if pathBasedOnLength
      l = @length()

      .add(@topEdge().scale random.get())
      .add(@leftEdge().scale random.get())

  # Returns the length {Number} of the rectangle perimeter.
  #
  # Returns a {Number}.
  length: -> @width * 2 + @height * 2

  # Returns a [Point]{agt.geom.Point} on the rectangle perimeter using
  # a {Number} between `0` and `1`.
  #
  # <script>drawGeometry('rectangle', {paths: [0, 1/3, 2/3]})</script>
  #
  # n - A {Number} between `0` and `1`a {Number} between `0` and `1`.
  # pathBasedOnLength - A {Boolean} of whether the position on the path
  #                     consider the length of the path segments or not.
  #                     When true, each segment will only weight as much
  #                     as their own length.
  #                     When false, every segment have the same weight,
  #                     resulting in a difference in speed when animating
  #                     an object along a path.
  #
  # Returns a [Point]{agt.geom.Point}.
  pathPointAt: (n, pathBasedOnLength=true) ->
    [p1,p2,p3] = @pathSteps pathBasedOnLength

