Ellipse drawing taken from looking at the control points in Inkscape
 Think of it like a rectangle. Curves go from mid-points of the sides
 of the rectangle. Control points are at 1/4 and 3/4 of the side.
 :nodoc:
 @api private
189746
def ellipse(box, draw, trans)
      x, y, w, h = box.x, box.y, box.width, box.height
      use_cairo do |cc|
        cc.rotate_about(box.x, box.y, trans.angle)
        cc.move_to(x, y + 0.5 * h)       # start west
        cc.curve_to(x, y + 0.25 * h,     # west to north
                    x + 0.25 * w, y,
                    x + 0.5 * w, y)
        cc.curve_to(x + 0.75 * w, y,     # north to east
                    x + w, y + 0.25 * h,
                    x + w, y + 0.5 * h)
        cc.curve_to(x + w, y + 0.75 * h, # east to south
                    x + 0.75 * w, y + h,
                    x + 0.5 * w, y + h)
        cc.curve_to(x + 0.25 * w, y + h, # south to west
                    x, y + 0.75 * h,
                    x, y + 0.5 * h)
        cc.fill_n_stroke(draw)
      end
    end
1099791
function drawSpline(plot, ctx, series) {
        // Not interested if spline is not requested
        if (series.splines.show !== true) {
            return;
        }

        var cp = [],
        // array of control points
            tension = series.splines.tension || 0.5,
            idx, x, y, points = series.datapoints.points,
            ps = series.datapoints.pointsize,
            plotOffset = plot.getPlotOffset(),
            len = points.length,
            pts = [];

        line = [];

        // Cannot display a linespline/areaspline if there are less than 3 points
        if (len / ps < 4) {
            $.extend(series.lines, series.splines);
            return;
        }

        for (idx = 0; idx < len; idx += ps) {
            x = points[idx];
            y = points[idx + 1];
            if (x == null || x < series.xaxis.min || x > series.xaxis.max || y < series.yaxis.min || y > series.yaxis.max) {
                continue;
            }

            pts.push(series.xaxis.p2c(x) + plotOffset.left, series.yaxis.p2c(y) + plotOffset.top);
        }

        len = pts.length;

        // Draw an open curve, not connected at the ends
        for (idx = 0; idx < len - 2; idx += 2) {
            cp = cp.concat(getControlPoints.apply(this, pts.slice(idx, idx + 6).concat([tension])));
        }

        ctx.save();
        ctx.strokeStyle = series.color;
        ctx.lineWidth = series.splines.lineWidth;

        queue(ctx, 'quadratic', pts.slice(0, 4), cp.slice(0, 2));

        for (idx = 2; idx < len - 3; idx += 2) {
            queue(ctx, 'bezier', pts.slice(idx, idx + 4), cp.slice(2 * idx - 2, 2 * idx + 2));
        }

        queue(ctx, 'quadratic', pts.slice(len - 2, len), [cp[2 * len - 10], cp[2 * len - 9], pts[len - 4], pts[len - 3]]);

        drawLine(line, ctx, plot.height() + 10, series.splines.fill, series.color);

        ctx.restore();
    }
1249332
def _draw_ellipse(data, obj, draw_options):
    
    if isinstance(obj, mpl.patches.Circle):
        # circle specialization
        return _draw_circle(data, obj, draw_options)
    x, y = obj.center
    ff = data["float format"]

    if obj.angle != 0:
        fmt = "rotate around={{" + ff + ":(axis cs:" + ff + "," + ff + ")}}"
        draw_options.append(fmt.format(obj.angle, x, y))

    cont = (
        "\\draw[{}] (axis cs:"
        + ff
        + ","
        + ff
        + ") ellipse ("
        + ff
        + " and "
        + ff
        + ");\n"
    ).format(",".join(draw_options), x, y, 0.5 * obj.width, 0.5 * obj.height)
    return data, cont
417204
function(state, source, target, points, result)
	{
		var view = state.view;
		var pt = (points != null && points.length > 0) ? points[0] : null;
		var pts = state.absolutePoints;
		var p0 = pts[0];
		var pe = pts[pts.length-1];
		
		if (pt != null)
		{
			pt = view.transformControlPoint(state, pt);
		}
		
		if (p0 != null)
		{
			source = new mxCellState();
			source.x = p0.x;
			source.y = p0.y;
		}
		
		if (pe != null)
		{
			target = new mxCellState();
			target.x = pe.x;
			target.y = pe.y;
		}

		if (source != null && target != null)
		{
			var t = Math.max(source.y, target.y);
			var b = Math.min(source.y + source.height,
							 target.y + target.height);
	
			var x = view.getRoutingCenterX(source);
			
			if (pt != null &&
				pt.x >= source.x &&
				pt.x <= source.x + source.width)
			{
				x = pt.x;
			}
			
			var y = (pt != null) ? pt.y : Math.round(b + (t - b) / 2);
			
			if (!mxUtils.contains(target, x, y) &&
				!mxUtils.contains(source, x, y))
			{
				result.push(new mxPoint(x, y));						
			}
			
			if (pt != null &&
				pt.x >= target.x &&
				pt.x <= target.x + target.width)
			{
				x = pt.x;
			}
			else
			{
				x = view.getRoutingCenterX(target);
			}
			
			if (!mxUtils.contains(target, x, y) &&
				!mxUtils.contains(source, x, y))
			{
				result.push(new mxPoint(x, y));						
			}
			
			if (result.length == 1)
			{
				if (pt != null && result.length == 1)
				{
					if (!mxUtils.contains(target, pt.x, y) &&
						!mxUtils.contains(source, pt.x, y))
					{
						result.push(new mxPoint(pt.x, y));
					}
				}
				else
				{
					var l = Math.max(source.x, target.x);
					var r = Math.min(source.x + source.width,
							 target.x + target.width);
						 
					result.push(new mxPoint(l + (r - l) / 2, y));
				}
			}
		}
	}
833454
def draw_rectangle(point, size, z_index, colour)
      left    = point.x
      top     = point.y
      width   = size.width
      height  = size.height

      draw_quad(
        left, top, colour,
        left + width, top, colour,
        left + width, top + height, colour,
        left, top + height, colour,
        z_index)
    end
1062442
function drawLoop () {
  ctx.clearRect(0, 0, canvas.width, canvas.height)

  var centerX = canvas.width / 2
  var centerY = canvas.height / 2

  // draw circle
  ctx.beginPath()
  ctx.arc(centerX, centerY, 100, 0, 2 * Math.PI, false)
  ctx.fillStyle = 'yellow'
  ctx.fill()

  // draw three oscilloscopes in different positions and colors
  ctx.strokeStyle = 'lime'
  scope.draw(ctx, 0, 0, centerX, centerY)

  ctx.strokeStyle = 'cyan'
  scope.draw(ctx, centerX, 0, centerX, centerY)

  ctx.strokeStyle = 'red'
  scope.draw(ctx, 0, centerY, null, centerY)

  window.requestAnimationFrame(drawLoop)
}
1077803
def drawSector(self, center, point, beta, fullSector=True):
        
        center = Point(center)
        point = Point(point)
        l3 = "%g %g m\n"
        l4 = "%g %g %g %g %g %g c\n"
        l5 = "%g %g l\n"
        betar = math.radians(-beta)
        w360 = math.radians(math.copysign(360, betar)) * (-1)
        w90  = math.radians(math.copysign(90, betar))
        w45  = w90 / 2
        while abs(betar) > 2 * math.pi:
            betar += w360                       # bring angle below 360 degrees
        if not (self.lastPoint == point):
            self.draw_cont += l3 % JM_TUPLE(point * self.ipctm)
            self.lastPoint = point
        Q = Point(0, 0)                    # just make sure it exists
        C = center
        P = point
        S = P - C                               # vector 'center' -> 'point'
        rad = abs(S)                            # circle radius

        if not rad > 1e-5:
            raise ValueError("radius must be positive")

        alfa = self.horizontal_angle(center, point)
        while abs(betar) > abs(w90):            # draw 90 degree arcs
            q1 = C.x + math.cos(alfa + w90) * rad
            q2 = C.y + math.sin(alfa + w90) * rad
            Q = Point(q1, q2)              # the arc's end point
            r1 = C.x + math.cos(alfa + w45) * rad / math.cos(w45)
            r2 = C.y + math.sin(alfa + w45) * rad / math.cos(w45)
            R = Point(r1, r2)              # crossing point of tangents
            kappah = (1 - math.cos(w45)) * 4 / 3 / abs(R - Q)
            kappa = kappah * abs(P - Q)
            cp1 = P + (R - P) * kappa           # control point 1
            cp2 = Q + (R - Q) * kappa           # control point 2
            self.draw_cont += l4 % JM_TUPLE(list(cp1 * self.ipctm) + \
                                         list(cp2 * self.ipctm) + \
                                         list(Q * self.ipctm))

            betar -= w90                        # reduce parm angle by 90 deg
            alfa  += w90                        # advance start angle by 90 deg
            P = Q                               # advance to arc end point
        # draw (remaining) arc
        if abs(betar) > 1e-3:                   # significant degrees left?
            beta2 = betar / 2
            q1 = C.x + math.cos(alfa + betar) * rad
            q2 = C.y + math.sin(alfa + betar) * rad
            Q = Point(q1, q2)              # the arc's end point
            r1 = C.x + math.cos(alfa + beta2) * rad / math.cos(beta2)
            r2 = C.y + math.sin(alfa + beta2) * rad / math.cos(beta2)
            R = Point(r1, r2)              # crossing point of tangents
            # kappa height is 4/3 of segment height
            kappah = (1 - math.cos(beta2)) * 4 / 3 / abs(R - Q) # kappa height
            kappa = kappah * abs(P - Q) / (1 - math.cos(betar))
            cp1 = P + (R - P) * kappa           # control point 1
            cp2 = Q + (R - Q) * kappa           # control point 2
            self.draw_cont += l4 % JM_TUPLE(list(cp1 * self.ipctm) + \
                                         list(cp2 * self.ipctm) + \
                                         list(Q * self.ipctm))
        if fullSector:
            self.draw_cont += l3 % JM_TUPLE(point * self.ipctm)
            self.draw_cont += l5 % JM_TUPLE(center * self.ipctm)
            self.draw_cont += l5 % JM_TUPLE(Q * self.ipctm)
        self.lastPoint = Q
        return self.lastPoint
501599
function (poly, fill) {
            var context = this.backBufferContext2D;

            if (context.globalAlpha < 1 / 255) {
                // Fast path: don't draw fully transparent
                return;
            }

            this.translate(poly.pos.x, poly.pos.y);
            context.beginPath();
            context.moveTo(poly.points[0].x, poly.points[0].y);
            var point;
            for (var i = 1; i < poly.points.length; i++) {
                point = poly.points[i];
                context.lineTo(point.x, point.y);
            }
            context.lineTo(poly.points[0].x, poly.points[0].y);
            context[fill === true ? "fill" : "stroke"]();
            context.closePath();
            this.translate(-poly.pos.x, -poly.pos.y);
        }
1314019
def ellipse(self, x, y, width, height, color):
        
        self.context.set_source_rgb(*color)
        self.context.save()
        self.context.translate(self.tx(x + (width / 2.0)), self.ty(y + (height / 2.0)))
        self.context.scale(self.tx(width / 2.0), self.ty(height / 2.0))
        self.context.arc(0.0, 0.0, 1.0, 0.0, 2 * math.pi)
        self.context.fill()
        self.context.restore()
1322701
@Override
	public String drawAxes() {
		StringBuilder s = new StringBuilder();
//		Point3d centroid = helixAxisAligner.getCentroid();
//		System.out.println("Centroid: " + helixAxisAligner.getCentroid());
//		Point3d centroid = helixAxisAligner.getGeometricCenter();
		Point3d centroid = helixAxisAligner.calcCenterOfRotation();
//		System.out.println("Geometric center: " + centroid);
		AxisAngle4d axisAngle = helixAxisAligner.getHelixLayers().getByLowestAngle().getAxisAngle();
		Vector3d axis = new Vector3d(axisAngle.x, axisAngle.y, axisAngle.z);

		s.append("draw axesHelical");
		s.append(name);
		s.append(0);
		s.append(" ");
		s.append("line");
		Point3d v1 = new Point3d(axis);
		v1.scale(AXIS_SCALE_FACTOR*(helixAxisAligner.getDimension().y + SIDE_CHAIN_EXTENSION));
		Point3d v2 = new Point3d(v1);
		v2.negate();
		v1.add(centroid);
		v2.add(centroid);
		s.append(getJmolPoint(v1));
		s.append(getJmolPoint(v2));
		s.append("width 1.0 ");
		s.append(" color red");
		s.append(" off;");
		return s.toString();
	}
550385
function(node,x,y,size,color,context) {
    context.fillStyle = 'yellow';
    context.beginPath();
    context.arc(x,y,size,1.25*Math.PI,0,false);
    context.arc(x,y,size,0,0.75*Math.PI,false);
    context.lineTo(x,y);
    context.closePath();
    context.fill();

    context.fillStyle = 'white';
    context.strokeStyle = 'black';
    context.beginPath();
    context.arc(x+size/3,y-size/3,size/4,0,2*Math.PI,false);
    context.closePath();
    context.fill();
    context.stroke();

    context.fillStyle = 'black';
    context.beginPath();
    context.arc(x+4*size/9,y-size/3,size/8,0,2*Math.PI,false);
    context.closePath();
    context.fill();
  }
1351741
def line(coord, draw)
      line_xy(coord.x1, coord.y1, coord.x2, coord.y2, draw)
    end
179139
function parseTMXShapes() {
         var i = 0;
         var shapes = []; // add an ellipse shape

         if (this.isEllipse === true) {
           // ellipse coordinates are the center position, so set default to the corresonding radius
           shapes.push(new me.Ellipse(this.width / 2, this.height / 2, this.width, this.height).rotate(this.rotation));
         } // add a polygon
         else if (this.isPolygon === true) {
             shapes.push(new me.Polygon(0, 0, this.points).rotate(this.rotation));
           } // add a polyline
           else if (this.isPolyLine === true) {
               var p = this.points;
               var p1, p2;
               var segments = p.length - 1;

               for (i = 0; i < segments; i++) {
                 // clone the value before, as [i + 1]
                 // is reused later by the next segment
                 p1 = new me.Vector2d(p[i].x, p[i].y);
                 p2 = new me.Vector2d(p[i + 1].x, p[i + 1].y);

                 if (this.rotation !== 0) {
                   p1 = p1.rotate(this.rotation);
                   p2 = p2.rotate(this.rotation);
                 }

                 shapes.push(new me.Line(0, 0, [p1, p2]));
               }
             } // it's a rectangle, returns a polygon object anyway
             else {
                 shapes.push(new me.Polygon(0, 0, [new me.Vector2d(), new me.Vector2d(this.width, 0), new me.Vector2d(this.width, this.height), new me.Vector2d(0, this.height)]).rotate(this.rotation));
               } // Apply isometric projection


         if (this.orientation === "isometric") {
           for (i = 0; i < shapes.length; i++) {
             shapes[i].toIso();
           }
         }

         return shapes;
       }
320486
def rectangle(self, clear_screen=True, x1=10, y1=10, x2=80, y2=40, fill_color='black', outline_color='black'):
        

        if clear_screen:
            self.clear()

        return self.draw.rectangle((x1, y1, x2, y2), fill=fill_color, outline=outline_color)
432224
function drawCell(cell, canvas, loc, fill) {
  // Also takes in a number and outputs a cell.
  if (typeof loc == 'undefined') loc = {x: 0, y: 0};
  if (typeof fill == 'undefined') fill = '#8ED6FF';

  var quadrant_width = 50;
  // Given a number in a quadrant and a location specifying the top left corner of
  // the quadrant, draw the relevant shape.
  function drawQuadrant(n, q, loc) {
    // draw upper triangle going certain direction at location
    function drawUpperTriangle(d, loc) {
      if (d == "r") {
        var first = {x: 50, y: 0};
        var second = {x: 50, y: 50};
      } else {
        var first = {x: 50, y: 0};
        var second = {x: 0, y: 50};
      }
      context.beginPath();
      context.moveTo(loc.x, loc.y);
      context.lineTo(loc.x + first.x, loc.y + first.y);
      context.lineTo(loc.x + second.x, loc.y + second.y);
      context.lineTo(loc.x, loc.y);
      context.lineWidth = 1;
      context.strokeStyle = 'black';
      context.stroke();
      context.fillStyle = fill;
      context.fill();
      context.closePath();
    }
    function drawLowerTriangle(d, loc) {
      if (d == "r") {
        loc = {x: loc.x + 50, y: loc.y};
        var first = {x: 0, y: 50};
        var second = {x: -50, y: 50};
      } else {
        var first = {x: 50, y: 50};
        var second = {x: 0, y: 50};
      }
      context.beginPath();
      context.moveTo(loc.x, loc.y);
      context.lineTo(loc.x + first.x, loc.y + first.y);
      context.lineTo(loc.x + second.x, loc.y + second.y);
      context.lineTo(loc.x, loc.y);
      context.lineWidth = 1;
      context.strokeStyle = 'black';
      context.stroke();
      context.fillStyle = fill;
      context.fill();
      context.closePath();
    }
    function drawTileOutline(loc) {
      context.beginPath();
      context.moveTo(loc.x, loc.y);
      context.lineTo(loc.x + 50, loc.y);
      context.lineTo(loc.x + 50, loc.y + 50);
      context.lineTo(loc.x, loc.y + 50);
      context.lineTo(loc.x, loc.y);
      context.lineWidth = 1;
      context.strokeStyle = 'black';
      context.stroke();
      context.closePath();
    }
    // blank space, just draw outline without filling.
    if (n == 0) {
      drawTileOutline(loc);
    } else if (n == 1) { // tile.
      context.beginPath();
      context.moveTo(loc.x, loc.y);
      context.lineTo(loc.x + 50, loc.y);
      context.lineTo(loc.x + 50, loc.y + 50);
      context.lineTo(loc.x, loc.y + 50);
      context.lineTo(loc.x, loc.y);
      context.lineWidth = 1;
      context.strokeStyle = 'black';
      context.stroke();
      context.fillStyle = fill;
      context.fill();
      context.closePath();
    } else if (n == 2) {
      drawTileOutline(loc);
      if (q == 0 || q == 2) {
        drawLowerTriangle("l", loc);
      } else {
        drawLowerTriangle("r", loc);
      }
    } else if (n == 3) {
      drawTileOutline(loc);
      if (q == 0 || q == 2) {
        drawUpperTriangle("r", loc);
      } else {
        drawUpperTriangle("l", loc);
      }
    }
  }
  var context = canvas.getContext('2d');
  var offsets = [
    {x: 0, y: 0},
    {x: 50, y: 0},
    {x: 50, y: 50},
    {x: 0, y: 50}
  ];

  // number at element, quadrant
  cell.array.forEach(function(n, q) {
    var offset = offsets[q];
    var new_loc = {x: loc.x + offset.x, y: loc.y + offset.y};
    drawQuadrant(n, q, new_loc);
  });
}
736207
private static Point getEllipseIntersection(Shape shape,
                                                Line2D.Double line) {
        double angle = Math.atan2(line.y2 - line.y1,
                                  line.x2 - line.x1);
        double x = shape.getBounds2D().getWidth() / 2 * Math.cos(angle) + shape.getBounds2D().getCenterX();
        double y = shape.getBounds2D().getHeight() / 2 * Math.sin(angle) + shape.getBounds2D().getCenterY();
        Point p = new Point();
        p.setLocation(x,
                      y);
        return p;
    }
447561
private void drawTriangle(ShaderBuffer out1, float x1, float y1, float z1, float w1,
                              ShaderBuffer out2, float x2, float y2, float z2, float w2,
                              ShaderBuffer out3, float x3, float y3, float z3, float w3,
                              ShaderImplementation fragmentShader, ShaderBuffer fragmentIn, ShaderBuffer fragmentOut) {
        // (28).(4) (in bits) fixed-point coordinates
        final int fy1 = Math.round(y1 * 16);
        final int fy2 = Math.round(y2 * 16);
        final int fy3 = Math.round(y3 * 16);
        final int fx1 = Math.round(x1 * 16);
        final int fx2 = Math.round(x2 * 16);
        final int fx3 = Math.round(x3 * 16);
        // Deltas
        final int dx12 = fx1 - fx2;
        final int dx23 = fx2 - fx3;
        final int dx31 = fx3 - fx1;
        final int dy12 = fy1 - fy2;
        final int dy23 = fy2 - fy3;
        final int dy31 = fy3 - fy1;
        // Fixed-point deltas
        final int fdx12 = dx12 << 4;
        final int fdx23 = dx23 << 4;
        final int fdx31 = dx31 << 4;
        final int fdy12 = dy12 << 4;
        final int fdy23 = dy23 << 4;
        final int fdy31 = dy31 << 4;
        // Block size, standard 8x8 (must be power of two), here 2^3
        final int block = 1 << 3;
        // Bounding rectangle, start in the corner of the 8x8 block
        final int minX = Math.min(fx1, Math.min(fx2, fx3)) + 0xf >> 4 & ~(block - 1);
        final int maxX = Math.max(fx1, Math.max(fx2, fx3)) + 0xf >> 4;
        final int minY = Math.min(fy1, Math.min(fy2, fy3)) + 0xf >> 4 & ~(block - 1);
        final int maxY = Math.max(fy1, Math.max(fy2, fy3)) + 0xf >> 4;
        // Determinant of deltas to compute the normalized barycentric coordinates for interpolation
        final float det = dx23 * dy12 - dy23 * dx12;
        // Barycentric coordinates
        int c1 = dy12 * fx1 - dx12 * fy1;
        int c2 = dy23 * fx2 - dx23 * fy2;
        int c3 = dy31 * fx3 - dx31 * fy3;
        // Correct for fill convention
        if (dy12 < 0 || dy12 == 0 && dx12 > 0) {
            c1++;
        }
        if (dy23 < 0 || dy23 == 0 && dx23 > 0) {
            c2++;
        }
        if (dy31 < 0 || dy31 == 0 && dx31 > 0) {
            c3++;
        }
        // Loop through blocks
        for (int by = minY; by < maxY; by += block) {
            for (int bx = minX; bx < maxX; bx += block) {
                // Corners of block
                final int bx0 = bx << 4;
                final int bx1 = bx + block - 1 << 4;
                final int by0 = by << 4;
                final int by1 = by + block - 1 << 4;
                // Evaluate half-space functions
                final boolean a00 = c1 + dx12 * by0 - dy12 * bx0 <= 0;
                final boolean a10 = c1 + dx12 * by0 - dy12 * bx1 <= 0;
                final boolean a01 = c1 + dx12 * by1 - dy12 * bx0 <= 0;
                final boolean a11 = c1 + dx12 * by1 - dy12 * bx1 <= 0;
                final boolean b00 = c2 + dx23 * by0 - dy23 * bx0 <= 0;
                final boolean b10 = c2 + dx23 * by0 - dy23 * bx1 <= 0;
                final boolean b01 = c2 + dx23 * by1 - dy23 * bx0 <= 0;
                final boolean b11 = c2 + dx23 * by1 - dy23 * bx1 <= 0;
                final boolean c00 = c3 + dx31 * by0 - dy31 * bx0 <= 0;
                final boolean c10 = c3 + dx31 * by0 - dy31 * bx1 <= 0;
                final boolean c01 = c3 + dx31 * by1 - dy31 * bx0 <= 0;
                final boolean c11 = c3 + dx31 * by1 - dy31 * bx1 <= 0;
                // Skip the block when outside an edge
                if (a00 && a10 && a01 && a11 || b00 && b10 && b01 && b11 || c00 && c10 && c01 && c11) {
                    continue;
                }
                // Compute the barycentric coordinates
                int cy1 = c1 + dx12 * by0 - dy12 * bx0;
                int cy2 = c2 + dx23 * by0 - dy23 * bx0;
                int cy3 = c3 + dx31 * by0 - dy31 * bx0;
                // Iterate the block
                for (int y = by; y < by + block; y++) {
                    int cx1 = cy1;
                    int cx2 = cy2;
                    int cx3 = cy3;
                    for (int x = bx; x < bx + block; x++) {
                        // Only draw pixels inside the triangle
                        if (cx1 > 0 && cx2 > 0 && cx3 > 0) {
                            // Compute the normalized barycentric coordinates
                            final float t = cx1 / det;
                            final float r = cx2 / det;
                            final float s = 1 - t - r;
                            // Lerp the rest of the data using the barycentric coordinates
                            final float z = SoftwareUtil.baryLerp(z1, z2, z3, r, s, t);
                            final float w = SoftwareUtil.baryLerp(w1, w2, w3, r, s, t);
                            fragmentIn.clear();
                            fragmentIn.writeRaw(Float.floatToIntBits(x));
                            fragmentIn.writeRaw(Float.floatToIntBits(y));
                            fragmentIn.writeRaw(Float.floatToIntBits(z));
                            fragmentIn.writeRaw(Float.floatToIntBits(w));
                            out1.position(4);
                            out2.position(4);
                            out3.position(4);
                            SoftwareUtil.baryLerp(out1, out2, out3, r, s, t, 1, fragmentIn);
                            fragmentIn.flip();
                            // Shade and write the fragment
                            writeFragment(fragmentShader, fragmentIn, fragmentOut, x, y, z);
                        }
                        cx1 -= fdy12;
                        cx2 -= fdy23;
                        cx3 -= fdy31;
                    }
                    cy1 += fdx12;
                    cy2 += fdx23;
                    cy3 += fdx31;
                }
            }
        }
    }