Did I find the right examples for you? yes no

All Samples(7)  |  Call(7)  |  Derive(0)  |  Import(0)
Get the midpoint of two points.

Example:
========
    >>> from sympy.geometry import Point
    >>> p1,p2 = Point(1, 1), Point(13, 5)
    >>> Point.midpoint(p1, p2)
    Point(7, 3)

            @staticmethod
    def midpoint(p1, p2):
        """
        Get the midpoint of two points.

        Example:
        ========
            >>> from sympy.geometry import Point
            >>> p1,p2 = Point(1, 1), Point(13, 5)
            >>> Point.midpoint(p1, p2)
            Point(7, 3)

        """
        return Point( [simplify((a + b)*S.Half) for a,b in zip(p1,p2)] )
        


src/s/y/sympy-HEAD/sympy/geometry/tests/test_geometry.py   sympy(Download)
    assert -p2 == Point(-y1, -y2)
 
    assert Point.midpoint(p3, p4) == Point(half, half)
    assert Point.midpoint(p1, p4) == Point(half + half*x1, half + half*x2)
    assert Point.midpoint(p2, p2) == p2
    assert p2.midpoint(p2) == p2

src/s/y/sympy-polys-HEAD/sympy/geometry/tests/test_geometry.py   sympy-polys(Download)
    assert -p2 == Point(-y1, -y2)
 
    assert Point.midpoint(p3, p4) == Point(half, half)
    assert Point.midpoint(p1, p4) == Point(half + half*x1, half + half*x2)
    assert Point.midpoint(p2, p2) == p2