Package: utnamgeo
utnamgeoPython library to solve 2d/3d coordinate geometryInstallationpip install utnamgeoRequirementspipinstallutnamtteDocumentationWays to importMethod 1importutnamgeoprint(utnamgeo.area_3d(...))Method 2fromutnamgeoimportarea_3dprint(area_3d(...))Method 3fromutnamgeoimportarea_3dasxyprint(xy(...))Method 4 ( my favourite)fromutnamgeoimport*print(area_3d(...))Useful functionsarea_2d#returns area of triangle with vertices (x1, y1) (x2, y2) and (x3, y3)area=area_2d(x1,y1,x2,y2,x3,y3)area_3d#returns area of triangle in 3d space with vertices (x1, y1, z1) (x2, y2, z2) and (x3, y3, z3)area=area_3d(x1,y1,z1,x2,y2,z2,x3,y3,z3)fop# returns the x, y, z coordinates of the foot of perpendicular drawn from the point (x3, y3, z3) to the line joining (x1, y1, z1) and  (x2, y2, z2)xn,xd,yn,yd,zn,zd=fop(x1,y1,z1,x2,y2,z2,x3,y3,z3)#returns numerator and denominator of the coordinatesgcd# returns the HCF(highest common factor) or GCD( Greatest common divisor) {both meaning the same} of two numbershcf=gcd(a,b)intersect# returns the x, y, z, x(as fraction), y(as fraction), z(as fraction) coordinates of the point of intersection of two lines,# line 1: x-x1/(a1n/a1d) = y-y1/(b1n/b1d) = z-z1/(c1n/c1d)# line 2: x-x2/(a2n/a2d) = y-y/2(b2n/b2d) = z-z2/(c2n/c2d)xn,xd,yn,yd,zn,zd=intersect(x1,y1,z1,x2,y2,z2,x3,y3,z3)iscollinear# returns whether the three points in 2d space are collinear or notvalue=iscollinear(x1,y1,x2,y2,x3,y3)# returns True if collinear and False if notiscollinear_3d# returns whether the three points in 3d space are collinear or notvalue=iscollinear_3d(x1,y1,z1,x2,y2,z2,x3,y3,z3)# returns True if collinear and False if notperimeter_2d#returns perimeter of triangle with vertices (x1, y1) (x2, y2) and (x3, y3)peri=peri_2d(x1,y1,x2,y2,x3,y3)perimeter_3d#yreturns perimeter of triangle in 3d space with vertices (x1, y1, z1) (x2, y2, z2) and (x3, y3, z3)peri=perimeter_3d(x1,y1,z1,x2,y2,z2,x3,y3,z3)CentresCentroid_2d# Centroid_2d(x1, y1, x2, y2, x3, y3)a=utnamgeo.Centroid_2d(0,2,3,7,6,3)print("x coordinate:",a.x)print("y coordinate:",a.y)Output:xcoordinate:3ycoordinate:4Centroid_3d# Centroid_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)a=utnamgeo.Centroid_3d(0,2,11,3,7,4,6,3,6)print("x coordinate:",a.x)print("y coordinate:",a.y)print("z coordinate:",a.z)Output:xcoordinate:3ycoordinate:4zcoordinate:7Circumcentre_2d# Circumcentre_2d(x1, y1, x2, y2, x3, y3)a=utnamgeo.Circumcentre_2d(2,-5,2,7,14,-5)print("x coordinate:",a.x)print("y coordinate:",a.y)Output:xcoordinate:8ycoordinate:1Circumcentre_3d# Circumcentre_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)a=utnamgeo.Circumcentre_3d(2,-5,-3,2,7,-3,14,-5,6)print("x coordinate:",a.x)print("y coordinate:",a.y)print("z coordinate:",a.z)Output:xcoordinate:8ycoordinate:1zcoordinate:5Excentre_2d# Excentre_2d(x1, y1, x2, y2, x3, y3)a=utnamgeo.Excentre_2d(2,-5,2,7,14,-5)print("x coordinate:",a.xa)print("y coordinate:",a.ya)Output:xcoordinate:5.11625...ycoordinate:-1.1046...Excentre_3d# Excentre_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)a=utnamgeo.Excentre_3d(2,-5,-3,2,7,-3,14,-5,6)print("x coordinate:",a.xa)print("y coordinate:",a.ya)print("z coordinate:",a.za)Output:xcoordinate:5.11625...ycoordinate:-1.1046...zcoordinate:-0.6628...Incentre_2d# Incentre_2d(x1, y1, x2, y2, x3, y3)a=utnamgeo.Incentre_2d(2,-5,2,7,14,-5)print("x coordinate:",a.x)print("y coordinate:",a.y)Output:xcoordinate:5.1162...ycoordinate:-1.1046...zcoordinate:-0.6628...Incentre_3d# Incentre_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)a=utnamgeo.Incentre_3d(2,-5,-3,2,7,-3,14,-5,6)print("x coordinate:",a.x)print("y coordinate:",a.y)print("z coordinate:",a.z)print("In-radius: ",a.radius)Output:xcoordinate:5.1162...ycoordinate:-1.1046...zcoordinate:-0.6628...In-radius:3.8953...Orthocentre_2d# Orthocentre_2d(x1, y1, x2, y2, x3, y3)a=utnamgeo.Orthocentre_2d(2,5,2,8,14,5)print("x coordinate:",a.x)print("y coordinate:",a.y)Output:xcoordinate:2ycoordinate:5Orthocentre_3d# Orthocentre_3d(x1, y1, z1, x2, y2, z2, x3, y3, z3)a=utnamgeo.Orthocentre_3d(2,-5,-3,2,7,-3,14,-5,6)print("x coordinate:",a.x)print("y coordinate:",a.y)print("z coordinate:",a.z)Output:xcoordinate:2ycoordinate:-5zcoordinate:-3▶️Package's YouTube tutorial hereChange Log0.0.2 (17/06/2023)Fixed Circumcentre_3d function