Skip to content

Commit

Permalink
Merge pull request #9 from nasa/bug_fixes
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
pjuangph authored May 22, 2024
2 parents 0ff3ea6 + 901d810 commit de5d49b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pyturbo/helper/bezier.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def flip(self):
def get_x_y(self):
return self.x,self.y

def get_curve_length(self):
def get_curve_length(self) -> float:
"""Gets the curve length
Returns:
Expand All @@ -53,7 +53,7 @@ def get_curve_length(self):
for i in range(0,len(x)-1):
d[i] = math.sqrt((x[i+1]-x[i])**2 + (y[i+1]-y[i])**2)

return sum(d) # Linear approximation of curve length
return sum(d)[0] # Linear approximation of curve length

def __equal_space__(self,t:np.ndarray,x,y):
"""
Expand Down
4 changes: 2 additions & 2 deletions pyturbo/helper/line2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ def line_intersect(self,line2):

t1 = T[0]; t2 = T[1]

[x, y] = r1.get_points(t1)
[x2, y2] = r2.get_points(t2)
[x, y] = r1.get_point(t1)
[x2, y2] = r2.get_point(t2)
if (math.sqrt((x-x2)**2 + (y-y2)**2) > 0.001):
return False

Expand Down

0 comments on commit de5d49b

Please sign in to comment.