Friday, October 24, 2025
HomeLanguagesPython | sympy is_collinear() method

Python | sympy is_collinear() method

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




# import sympy and geometry module
from sympy import *
from sympy.geometry import *
 
x = Point(0, 0)
y = Point(1, 1)
z = Point(2, 2)
 
# Using Point.is_collinear() method
isTrue = Point.is_collinear(x, y, z)
 
print(isTrue)


Output: 
 

True

Example #2: 
 

Python3




# import sympy and geometry module
from sympy import *
from sympy.geometry import *
 
x = Point(1, 0)
y = Point(1, 2)
z = Point(2, 2)
 
# Using Point.is_collinear() method
isTrue = Point.is_collinear(x, y, z)
 
print(isTrue)


Output: 
 

False

 

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS