A few basic concepts in geometry must also be commonly understood without being defined. One such concept is the idea that a point lies on a line or a plane.
Collinear points are the points which lie on the same line.
Coplanar points are the points which lie on the same plane.
Example 1 :
Look at the figure given below and answer the questions.
Collinear points: See the word line in collinear? Collinear points are points that lie on a line. Any two points are always collinear because you can always connect them with a straight line. Three or more points can be collinear, but they don’t have to be. The above figure shows collinear points P, Q, and R which all lie on a single line.
Non-collinear points: These points, like points X, Y, and Z in the above figure, don’t all lie on the same line.
Coplanar points: A group of points that lie in the same plane are coplanar. Any two or three points are always coplanar. Four or more points might or might not be coplanar.
The left side of the above figure shows coplanar points A, B, C, and D. And in the box on the right, there are many sets of coplanar points. Points P, Q, X, and W, for example, are coplanar; the plane that contains them is the left side of the box. Each of the six faces of the box contains four coplanar points, but these are not the only groups of coplanar points. For example points Q, X, S, and Z are coplanar even though the plane that contains them isn’t shown; it slices the box in half diagonally.
Non-coplanar points: A group of points that don’t all lie in the same plane are non-coplanar.
In the above figure, points P, Q, X, and Y are non-coplanar. The top of the box contains Q, X, and Y, and the left side contains P, Q, and X, but no flat surface contains all four points.
The affine rank of a set of points is the dimension of the smallest affine space containing all the points. For example, if the points lie on a line (and are not all the same) their affine rank is 1. If the points lie on a plane but not a line, their affine rank is 2. By convention, the empty set has affine rank -1.
property ambient_dimensionNumber of components this point has.
classmethod are_coplanar(*points)Return True if there exists a plane in which all the points lie. A trivial True value is returned if \(len(points) < 3\) or all Points are 2-dimensional.
Parameters:A set of points
Returns:boolean
Raises:ValueError : if less than 3 unique points are given
Examples
>>> from sympy import Point3D >>> p1 = Point3D(1, 2, 2) >>> p2 = Point3D(2, 7, 2) >>> p3 = Point3D(0, 0, 2) >>> p4 = Point3D(1, 1, 2) >>> Point3D.are_coplanar(p1, p2, p3, p4) True >>> p5 = Point3D(0, 1, 3) >>> Point3D.are_coplanar(p1, p2, p3, p5) False
canberra_distance(p)The Canberra Distance from self to point p.
Returns the weighted sum of horizontal and vertical distances to point p.
Parameters:p : Point
Returns:canberra_distance : The weighted sum of horizontal and vertical
distances to point p. The weight used is the sum of absolute values
of the coordinates.
Raises:ValueError when both vectors are zero.
Examples
>>> from sympy import Point >>> p1, p2 = Point(1, 1), Point(3, 3) >>> p1.canberra_distance(p2) 1 >>> p1, p2 = Point(0, 0), Point(3, 3) >>> p1.canberra_distance(p2) 2
See also
distance(other)The Euclidean distance between self and another GeometricEntity.
Returns:distance : number or symbolic expression.
Raises:TypeError : if other is not recognized as a GeometricEntity or is a
GeometricEntity for which distance is not defined.
Examples
>>> from sympy import Point, Line >>> p1, p2 = Point(1, 1), Point(4, 5) >>> l = Line((3, 1), (2, 2)) >>> p1.distance(p2) 5 >>> p1.distance(l) sqrt(2)
The computed distance may be symbolic, too:
>>> from sympy.abc import x, y >>> p3 = Point(x, y) >>> p3.distance((0, 0)) sqrt(x**2 + y**2)
See also
,
dot(p)Return dot product of self with another Point.
equals(other)Returns whether the coordinates of self and other agree.
intersection(other)The intersection between this point and another GeometryEntity.
Parameters:other : GeometryEntity or sequence of coordinates
Returns:intersection : list of Points
Notes
The return value will either be an empty list if there is no intersection, otherwise it will contain this point.
Examples
>>> from sympy import Point >>> p1, p2, p3 = Point(0, 0), Point(1, 1), Point(0, 0) >>> p1.intersection(p2) [] >>> p1.intersection(p3) [Point2D(0, 0)]
is_collinear(*args)Returns \(True\) if there exists a line that contains \(self\) and \(points\). Returns \(False\) otherwise. A trivially True value is returned if no points are given.
Parameters:args : sequence of Points
Returns:is_collinear : boolean
Examples
>>> from sympy import Point >>> from sympy.abc import x >>> p1, p2 = Point(0, 0), Point(1, 1) >>> p3, p4, p5 = Point(2, 2), Point(x, x), Point(1, 2) >>> Point.is_collinear(p1, p2, p3, p4) True >>> Point.is_collinear(p1, p2, p3, p5) False
See also
is_concyclic(*args)Do \(self\) and the given sequence of points lie in a circle?
Returns True if the set of points are concyclic and False otherwise. A trivial value of True is returned if there are fewer than 2 other points.
Parameters:args : sequence of Points
Returns:is_concyclic : boolean
Examples
>>> from sympy import Point
Define 4 points that are on the unit circle:
>>> p1, p2, p3, p4 = Point(1, 0), (0, 1), (-1, 0), (0, -1)
>>> Point(0.5, 0.25) Point2D(1/2, 1/4) >>> Point(0.5, 0.25, evaluate=False) Point2D(0.5, 0.25) 0
Define a point not on that circle:
>>> Point(0.5, 0.25) Point2D(1/2, 1/4) >>> Point(0.5, 0.25, evaluate=False) Point2D(0.5, 0.25) 1
>>> Point(0.5, 0.25) Point2D(1/2, 1/4) >>> Point(0.5, 0.25, evaluate=False) Point2D(0.5, 0.25) 2
property is_nonzeroTrue if any coordinate is nonzero, False if every coordinate is zero, and None if it cannot be determined.
is_scalar_multiple(p)Returns whether each coordinate of \(self\) is a scalar multiple of the corresponding coordinate in point p.
property is_zeroTrue if every coordinate is zero, False if any coordinate is not zero, and None if it cannot be determined.
property lengthTreating a Point as a Line, this returns 0 for the length of a Point.
Examples
>>> Point(0.5, 0.25) Point2D(1/2, 1/4) >>> Point(0.5, 0.25, evaluate=False) Point2D(0.5, 0.25) 3
midpoint(p)The midpoint between self and point p.
Parameters:p : Point
Returns:midpoint : Point
Examples
>>> Point(0.5, 0.25) Point2D(1/2, 1/4) >>> Point(0.5, 0.25, evaluate=False) Point2D(0.5, 0.25) 4
See also
property originA point of all zeros of the same ambient dimension as the current point
property orthogonal_directionReturns a non-zero point that is orthogonal to the line containing \(self\) and the origin.
Examples
>>> Point(0.5, 0.25) Point2D(1/2, 1/4) >>> Point(0.5, 0.25, evaluate=False) Point2D(0.5, 0.25) 5
static project(a, b)Project the point \(a\) onto the line between the origin and point \(b\) along the normal direction.
Parameters:a : Point
b : Point
Returns:p : Point
Examples
>>> Point(0.5, 0.25) Point2D(1/2, 1/4) >>> Point(0.5, 0.25, evaluate=False) Point2D(0.5, 0.25) 6
See also
taxicab_distance(p)The Taxicab Distance from self to point p.
Returns the sum of the horizontal and vertical distances to point p.
Parameters:p : Point
Returns:taxicab_distance : The sum of the horizontal
and vertical distances to point p.
Examples
>>> Point(0.5, 0.25) Point2D(1/2, 1/4) >>> Point(0.5, 0.25, evaluate=False) Point2D(0.5, 0.25) 7
See also
property unitReturn the Point that is in the same direction as \(self\) and a distance of 1 from the origin
class sympy.geometry.point.Point2D(*args, _nocheck=False, **kwargs)A point in a 2-dimensional Euclidean space.
Parameters:coords : sequence of 2 coordinate values.
Raises:TypeError
When trying to add or subtract points with different dimensions. When trying to create a point with more than two dimensions. When \(intersection\) is called with object other than a Point.
Examples
>>> Point(0.5, 0.25) Point2D(1/2, 1/4) >>> Point(0.5, 0.25, evaluate=False) Point2D(0.5, 0.25) 8
Floats are automatically converted to Rational unless the evaluate flag is False:
>>> Point(0.5, 0.25) Point2D(1/2, 1/4) >>> Point(0.5, 0.25, evaluate=False) Point2D(0.5, 0.25) 9
See also
Connects two Points
Attributes
x
y
length
property boundsReturn a tuple (xmin, ymin, xmax, ymax) representing the bounding rectangle for the geometric figure.
property coordinatesReturns the two coordinates of the Point.
Examples
>>> from sympy import Point3D >>> p1 = Point3D(1, 2, 2) >>> p2 = Point3D(2, 7, 2) >>> p3 = Point3D(0, 0, 2) >>> p4 = Point3D(1, 1, 2) >>> Point3D.are_coplanar(p1, p2, p3, p4) True >>> p5 = Point3D(0, 1, 3) >>> Point3D.are_coplanar(p1, p2, p3, p5) False 0
rotate(angle, pt=None)Rotate >>> from sympy import Point, Line >>> p1, p2 = Point(1, 1), Point(4, 5) >>> l = Line((3, 1), (2, 2)) >>> p1.distance(p2) 5 >>> p1.distance(l) sqrt(2) 7 radians counterclockwise about Point >>> from sympy import Point, Line >>> p1, p2 = Point(1, 1), Point(4, 5) >>> l = Line((3, 1), (2, 2)) >>> p1.distance(p2) 5 >>> p1.distance(l) sqrt(2) 8.
Examples
>>> from sympy import Point3D >>> p1 = Point3D(1, 2, 2) >>> p2 = Point3D(2, 7, 2) >>> p3 = Point3D(0, 0, 2) >>> p4 = Point3D(1, 1, 2) >>> Point3D.are_coplanar(p1, p2, p3, p4) True >>> p5 = Point3D(0, 1, 3) >>> Point3D.are_coplanar(p1, p2, p3, p5) False 1
See also
,
scale(x=1, y=1, pt=None)Scale the coordinates of the Point by multiplying by >>> from sympy.abc import x, y >>> p3 = Point(x, y) >>> p3.distance((0, 0)) sqrt(x**2 + y**2) 1 and >>> from sympy.abc import x, y >>> p3 = Point(x, y) >>> p3.distance((0, 0)) sqrt(x**2 + y**2) 2 after subtracting >>> from sympy import Point, Line >>> p1, p2 = Point(1, 1), Point(4, 5) >>> l = Line((3, 1), (2, 2)) >>> p1.distance(p2) 5 >>> p1.distance(l) sqrt(2) 8 – default is (0, 0) – and then adding >>> from sympy import Point, Line >>> p1, p2 = Point(1, 1), Point(4, 5) >>> l = Line((3, 1), (2, 2)) >>> p1.distance(p2) 5 >>> p1.distance(l) sqrt(2) 8 back again (i.e. >>> from sympy import Point, Line >>> p1, p2 = Point(1, 1), Point(4, 5) >>> l = Line((3, 1), (2, 2)) >>> p1.distance(p2) 5 >>> p1.distance(l) sqrt(2) 8 is the point of reference for the scaling).
Can 3 points be coplanar and not collinear?
For example, three points are always coplanar, and if the points are distinct and non-collinear, the plane they determine is unique. However, a set of four or more distinct points will, in general, not lie in a single plane.What coplanar points that are not collinear?
Points, lines, or shapes are non-coplanar if they do not lie in the same plane. Collinear points lie on the same line. If points are collinear, they are also coplanar. However, coplanar points are not necessarily collinear.What are coplanar points examples?
Points or lines are said to be coplanar if they lie in the same plane. Example 1: The points P , Q , and R lie in the same plane A . They are coplanar .