#Line file for the GeoMath library
from math import sqrt, atan, degrees
from geomath import point as p
import re

class Line:
    def __init__(self):
        """
        These are the initial line parameters
        """
        self.PointOne = 0
        self.PointTwo = 0
        self.Angulation = 0
        self.Angular = 0
        self.Linear = 0
        self.A = 0
        self.B = 0
        self.C = 0
        self.createdby = None

    def create(self,PointOne, PointTwo):
        """
        This function is for getting a line created by two points
        """
        self.PointOne = PointOne
        self.PointTwo = PointTwo
        self.createdby = "points"
        self.A = float(self.PointOne.y - self.PointTwo.y)
        self.B = float(self.PointTwo.x - self.PointOne.x)
        if self.B > 0 or self.B == 0:
            self.B = "+" + str(self.B)
        self.C = ((self.PointOne.x * self.PointTwo.y) - (self.PointOne.y * self.PointTwo.x))
        if self.C > 0 or self.C == 0:
            self.C = "+" + str(self.C)

    def create_via_equation(self, equation):
        """
        This function is for getting a line created by a line equation
        """
        self.createdby = "equation"
        regx = re.compile(r'(\W?\d+)\S(\W\d+)\S(\W\d+)\=(\W?\d+)')
        values = regx.findall(equation)
        values = values[0]
        self.A = values[0]
        self.B = values[1]
        self.C = values[2]
        self.Angular = (float(values[0]) / float(values[1]))
        self.Angulation = degrees(atan(float(self.Angular)))
        self.PointOne = p.Point(float(self.C) / float(self.A),0)
        self.PointTwo = p.Point(0, float(self.C) / float(self.B))


    def equation(self):
        return("{}x{}y{}=0".format(self.A, self.B, self.C))

    def get_angle(self):
        return(self.Angulation)

    def __repr__(self):
        if self.createdby == "equation":
            return("A: {} B: {} C: {}".format(self.A, self.B, self.C))
        elif self.createdby == "points":
            return("Line({},{})".format(self.PointOne, self.PointTwo))

    # HERE THE LINE ONLY ATTRIBUTES END

    def point_distance(self, PointTwo):
        EquationA = ((float(self.A) * float(PointTwo.x)) + (float(self.B) * float(PointTwo.y)) + float(self.C))
        if EquationA == 0:
            raise ValueError('Point is inside the line!')
        EquationB = sqrt((float(self.A) * float(self.A)) + (float(self.B) * float(self.B)))
        return((float(EquationA) / float(EquationB)))


    def comparisor(self, LineTwo):
        angLineTwo = LineTwo.Angular
        if self.Angular == angLineTwo:
            return("Paralell Lines")
        elif self.Angular is not angLineTwo:
            return("Function under development")
            #We need to detect the other types of lines
            #If angular and linear coefficient are different, they are different

    def point_alignment(self, PointThree):
        # [ 0, 0, 1 ]
        # [ 4, 4, 1 ]
        # [ 7, 7, 1 ]
        # This will return true or false
        pass

@@ -136,24 +136,41 @@
 _init__(self
+, *args, **kwargs
 ):%0A        %22
@@ -180,16 +180,225 @@
         
+    Using:%0A%0A            %3E%3E%3E line = l.Line(p.Point(2,2), p.Point(4,4))%0A            Line(Point(2, 2), Point(4, 4))%0A%0A            %3E%3E%3E line = l.Line(%22-8x+6y-8=0%22)%0A            A: -8 B: +6 C: -8%0A        %22%22%22%0A        #
 These ar
@@ -427,28 +427,16 @@
 ameters%0A
-        %22%22%22%0A
         
@@ -644,16 +644,491 @@
 = None%0A%0A
+        if len(args)%3E1:%0A            if isinstance(args%5B0%5D, p.Point) and isinstance(args%5B1%5D, p.Point):%0A                self.create(args%5B0%5D, args%5B1%5D)%0A%0A        if len(args)==1:%0A            if isinstance(args%5B0%5D, p.Point) and %22m%22 in kwargs:%0A                # Calculate line from the slope%0A                # Example using: line = l.Line(p.Point(2,2), m=4)%0A                pass%0A            %0A            elif type(args%5B0%5D) is str:%0A                self.create_via_equation(args%5B0%5D)%0A%0A
     def 
@@ -1139,16 +1139,17 @@
 te(self,
+ 
 PointOne
@@ -2709,16 +2709,17 @@
 Line(%7B%7D,
+ 
 %7B%7D)%22.for

Determine line values in the instance