Add 'Line' annot for points p1 and p2.
357679
def addLineAnnot(self, p1, p2):
        """"""
        CheckParent(self)

        val = _fitz.Page_addLineAnnot(self, p1, p2)

        if not val: return
        val.thisown = True
        val.parent = weakref.proxy(self)
        self._annot_refs[id(val)] = val

        return val
537715
def _quadPoints(size, disp1, disp2):
        """"""
        w, h = size
        x1, y1 = disp1
        x2, y2 = disp2

        return (
            x1,    -y1,
            -x1,    h + y2,
            w + x2, h - y2,
            w - x2, y1
        )
1031560
private function combineSumPoints($points1, $points2) {
        $pointsCount = count($points1);
        $currPoint = 0;
        foreach ($points2 as $point2) {
            $pointFound = false;
            //leverage the fact that points are sorted and improve O(n^2)
            while ($currPoint < $pointsCount) {
                $point1 = $points1[$currPoint];
                if ($point1['time'] == $point2['time']) {
                    $points1[$currPoint]['sum'] += $point2['sum'];
                    $currPoint++;
                    $pointFound = true;
                    break;
                }
                $currPoint++;
            }
            //point not found in downsampled array, then just append
            if (!$pointFound) {
                $points1[] = $point2;
            }
        }

        return $points1;
    }
200459
def add_to_line_plot(ax, x, y, color = '0.' , label = ''):
    '''  '''
    plt.sca(ax)
    plt.plot(x,y, color = color, label = label)
    return ax
718689
public void setLine (float x1, float y1, float x2, float y2) {
        this.x1 = x1;
        this.y1 = y1;
        this.x2 = x2;
        this.y2 = y2;
    }
638655
void bezierTo(Point2D controlPoint1, Point2D controlPoint2, Point2D endPoint) {
		m_impl.bezierTo(controlPoint1, controlPoint2, endPoint);
	}
465143
function pointRectangleSimple(p, a1, a2) {
    if (!(a1.x > p.x ||
        a2.x < p.x ||
        a1.y > p.y ||
        a2.y < p.y))
        return {result: collision.INSIDE};
    return {result: collision.OUTSIDE};
}
752677
def bezier_point(p, t):
    """"""

    # begin arc support block ########################
    try:
        p.large_arc
        return p.point(t)
    except:
        pass
    # end arc support block ##########################

    deg = len(p) - 1
    if deg == 3:
        return p[0] + t*(
            3*(p[1] - p[0]) + t*(
                3*(p[0] + p[2]) - 6*p[1] + t*(
                    -p[0] + 3*(p[1] - p[2]) + p[3])))
    elif deg == 2:
        return p[0] + t*(
            2*(p[1] - p[0]) + t*(
                p[0] - 2*p[1] + p[2]))
    elif deg == 1:
        return p[0] + t*(p[1] - p[0])
    elif deg == 0:
        return p[0]
    else:
        bern = bernstein(deg, t)
        return sum(bern[k]*p[k] for k in range(deg+1))
280293
def annotate(row, ax, x='x', y='y', text='name', xytext=(7, -5), textcoords='offset points', **kwargs):
    
    # idx = row.name
    text = row[text] if text in row else str(text)
    x = row[x] if x in row else float(x)
    y = row[y] if y in row else float(y)
    ax.annotate(text, (row[x], row[y]), xytext=xytext, textcoords=textcoords, **kwargs)
    return row[text]
530340
def annot(self, node):
        """"""
        self.annots.append(node)
        node.parent = self
1181603
void constructLinearSystem(List<DMatrixRMaj> homographies,
							   List<List<PointIndex2D_F64>> observations) {
		// parameters are encoded points first then the
		int startView = totalFeatures*3;

		A.reshape(numEquations,numUnknown);

		DMatrixRMaj H = new DMatrixRMaj(3,3);
		Point2D_F64 p = new Point2D_F64();

		int row = 0;
		for (int viewIdx = 0; viewIdx < homographies.size(); viewIdx++) {
			N.apply(homographies.get(viewIdx),H);

			int colView = startView + viewIdx*3;

			List<PointIndex2D_F64> obs = observations.get(viewIdx);
			for (int i = 0; i < obs.size(); i++) {
				PointIndex2D_F64 p_pixel = obs.get(i);

				N.apply(p_pixel,p);

				// column this feature is at
				int col = p_pixel.index*3;

				// x component of pixel
				// A(row,colView) =  ...
				A.data[row*A.numCols + col    ] = p.x*H.get(2,0) - H.get(0,0);
				A.data[row*A.numCols + col + 1] = p.x*H.get(2,1) - H.get(0,1);
				A.data[row*A.numCols + col + 2] = p.x*H.get(2,2) - H.get(0,2);

				A.data[row*A.numCols + colView     ] = -1;
				A.data[row*A.numCols + colView + 1 ] = 0;
				A.data[row*A.numCols + colView + 2 ] = p.x;

				// y component of pixel
				row += 1;
				A.data[row*A.numCols + col    ] = p.y*H.get(2,0) - H.get(1,0);
				A.data[row*A.numCols + col + 1] = p.y*H.get(2,1) - H.get(1,1);
				A.data[row*A.numCols + col + 2] = p.y*H.get(2,2) - H.get(1,2);

				A.data[row*A.numCols + colView     ] = 0;
				A.data[row*A.numCols + colView + 1 ] = -1;
				A.data[row*A.numCols + colView + 2 ] = p.y;

				row += 1;
			}
		}
	}
382924
function(x1, y1, x2, y2) {
      return this.put(new SVG.Line).plot(x1, y1, x2, y2)
    }
832860
public static void drawLine(Point p1, Point p2, PlotOperator plot)
    {
        drawLine(p1.x, p1.y, p2.x, p2.y, plot);
    }
418670
def addUnderlineAnnot(self, rect):
        """"""
        CheckParent(self)

        val = _fitz.Page_addUnderlineAnnot(self, rect)

        if not val: return
        val.thisown = True
        val.parent = weakref.proxy(self)
        self._annot_refs[id(val)] = val

        return val
290834
private void fillM( Point2D_F64 x1 , Point2D_F64 x2 , Point2D_F64 x3 ) {
		M.data[0] = x1.x; M.data[1] = x1.y; M.data[2] = 1;
		M.data[3] = x2.x; M.data[4] = x2.y; M.data[5] = 1;
		M.data[6] = x3.x; M.data[7] = x3.y; M.data[8] = 1;
	}
942884
public void bezierTo(Point2D controlPoint1, Point2D controlPoint2,
			Point2D endPoint) {
		_beforeNewSegment(1);
		setXY(m_pointCount - 1, endPoint);
		double z;
		_initSegmentData(6);
		m_pathFlags.setBits(m_pathFlags.size() - 1,
				(byte) PathFlags.enumHasNonlinearSegments);
		m_segmentParamIndex.write(m_pointCount - 2, m_curveParamwritePoint);
		m_curveParamwritePoint += 6;
		int curveIndex = m_curveParamwritePoint;
		m_segmentParams.write(curveIndex, controlPoint1.x);
		m_segmentParams.write(curveIndex + 1, controlPoint1.y);
		z = 0;// TODO: calculate me.
		m_segmentParams.write(curveIndex + 2, z);
		m_segmentParams.write(curveIndex + 3, controlPoint2.x);
		m_segmentParams.write(curveIndex + 4, controlPoint2.y);
		z = 0;// TODO: calculate me.
		m_segmentParams.write(curveIndex + 5, z);
		_finishBezierTo();
	}
1285588
def pointm(self, x, y, m=None):
        """"""
        shapeType = POINTM
        pointShape = Shape(shapeType)
        pointShape.points.append([x, y, m])
        self.shape(pointShape)