So basically I have two problems which I need to solve for a whole bunch of times I have been using SymPy to solve each problem and while that works it simply runs to slow.
The first problem is I need to convert two line segments which I have the points for into lines and then find the intercept point of those lines. each line segment by itself does not intercept the other. I also need to find the angle between each of these lines in degrees. Below is the SymPy code that I am currently using with some example values while it works its to slow and I need to find another way to solve this that is significantly faster.
first problem:
import math
from sympy import Point, Line, Segment, Polygon
p1=Point(1, 4)
p2=Point(8, 8)
p3=Point(10, 10)
p4=Point(16, 16)
l1 = Line(p1, p2)
l2 = Line(p3, p4)
showIntersection = l1.intersection(l2)
unList=showIntersection[0]
points=unList.coordinates
angle = float(l1.angle_between(l2))
angleDegrees = angle*(180/math.pi)
x0inter=float(points[0])
y0inter=float(points[1])
the second problem is simpler I need to find if point('s) are enclosed inside a four sided polygon. I could use example code or advice on which library I should use.