Python | sympy is_collinear() method
Last Updated :
17 Sep, 2021
The function is_collinear() enables us to check whether the given points(coordinates) are collinear
or not.
Syntax:
Parameters: x, y, z are coordinates.
Return: True : if points are collinear, otherwise False.
Example #1:
Python3
from sympy import *
from sympy.geometry import *
x = Point( 0 , 0 )
y = Point( 1 , 1 )
z = Point( 2 , 2 )
isTrue = Point.is_collinear(x, y, z)
print (isTrue)
|
Output:
True
Example #2:
Python3
from sympy import *
from sympy.geometry import *
x = Point( 1 , 0 )
y = Point( 1 , 2 )
z = Point( 2 , 2 )
isTrue = Point.is_collinear(x, y, z)
print (isTrue)
|
Output:
False
Share your thoughts in the comments
Please Login to comment...