Doubles this point.

        Returns:
            AffinePoint: The point corresponding to `2 * self`.
171028
def double(self):
        
        X1, Y1, a, P = self.X, self.Y, self.a, self.P

        if self.infinity:
            return self

        S = ((3 * X1 ** 2 + a) * self.inverse(2 * Y1)) % P
        X2 = (S ** 2 - (2 * X1)) % P
        Y2 = (S * (X1 - X2) - Y1) % P
        return AffinePoint(X2, Y2)
902878
def points_to_double(self):
        
        if self.points.dtype != np.double:
            self.points = self.points.astype(np.double)
733339
def Times(self, val):
    
    return Point(self.x * val, self.y * val, self.z * val)
1248055
def center(self) -> Point2:
        
        assert self
        pos = Point2(
            (
                sum([unit.position.x for unit in self]) / self.amount,
                sum([unit.position.y for unit in self]) / self.amount,
            )
        )
        return pos
548202
def point2upoint(point):
    """"""
    upoint = [set(), set()]
    for v, val in point.items():
        upoint[val].add(v.uniqid)
    upoint[0] = frozenset(upoint[0])
    upoint[1] = frozenset(upoint[1])
    return tuple(upoint)
590313
@Pure
	public double distance(Point2D<?, ?> point) {
		assert point != null;
		final GeoLocationPoint p = getGeoPosition();
		if (p != null) {
			return Point2D.getDistancePointPoint(p.getX(), p.getY(), point.getX(), point.getY());
		}
		return Double.NaN;
	}
46027
def upoint2exprpoint(upoint):
    
    point = dict()
    for uniqid in upoint[0]:
        point[_LITS[uniqid]] = 0
    for uniqid in upoint[1]:
        point[_LITS[uniqid]] = 1
    return point
453410
def affine_map(points1, points2):
    
    A = np.ones((4, 4))
    A[:, :3] = points1
    B = np.ones((4, 4))
    B[:, :3] = points2

    # solve 3 sets of linear equations to determine
    # transformation matrix elements
    matrix = np.eye(4)
    for i in range(3):
        # solve Ax = B; x is one row of the desired transformation matrix
        matrix[i] = np.linalg.solve(A, B[:, i])

    return matrix
1133138
def _distance_squared(self, p2: "Point2") -> Union[int, float]:
        
        return (self[0] - p2[0]) ** 2 + (self[1] - p2[1]) ** 2
992542
public Point2 add(Point2 that) {
    return new Point2(x + that.x, y + that.y);
  }
74922
private Point getPoint(Vector2f pt) {
		Point p = nextFreePoint;
		if (p != null) {
			nextFreePoint = p.next;
			// initialize new point to safe values
			p.next = null;
			p.prev = null;
			p.pt = pt;
			return p;
		}
		return new Point(pt);
	}
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
        )
54209
def affine(self, func:AffineFunc, *args, **kwargs)->'Image':
        ""
        m = tensor(func(*args, **kwargs)).to(self.device)
        self.affine_mat = self.affine_mat @ m
        return self
358562
def point(self, t):
        """"""
        # algebraically equivalent to
        # P0*(1-t)**3 + 3*P1*t*(1-t)**2 + 3*P2*(1-t)*t**2 + P3*t**3
        # for (P0, P1, P2, P3) = self.bpoints()
        return self.start + t*(
            3*(self.control1 - self.start) + t*(
                3*(self.start + self.control2) - 6*self.control1 + t*(
                    -self.start + 3*(self.control1 - self.control2) + self.end
                )))
762066
private static boolean multiPointWithinPoint_(MultiPoint multipoint_a,
			Point point_b, double tolerance, ProgressTracker progress_tracker) {
		return multiPointEqualsPoint_(multipoint_a, point_b, tolerance,
				progress_tracker);
	}
702445
def transform(self, m):
        """"""
        if len(m) != 6:
            raise ValueError("bad sequ. length")
        self.x, self.y = TOOLS._transform_point(self, m)
        return self
754448
def tValueForPoint(self, point):
        
        if self.segmentType == "curve":
            on1 = self.previousOnCurve
            off1 = self.points[0].coordinates
            off2 = self.points[1].coordinates
            on2 = self.points[2].coordinates
            return _tValueForPointOnCubicCurve(point, (on1, off1, off2, on2))
        elif self.segmentType == "line":
            return _tValueForPointOnLine(point, (self.previousOnCurve, self.points[0].coordinates))
        elif self.segmentType == "qcurve":
            raise NotImplementedError
        else:
            raise NotImplementedError