Skip to content

Commit

Permalink
fix rdp_simplify_2d_path
Browse files Browse the repository at this point in the history
  • Loading branch information
orso82 committed Sep 30, 2023
1 parent d256cbd commit a6723a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,11 @@ allowed between a point on the original line and its simplified representation.
"""
function rdp_simplify_2d_path(x::AbstractArray{T}, y::AbstractArray{T}, epsilon::T) where {T<:Real}
n = length(x)
if n < 3 || n != length(y)
if n != length(y)
error("Input arrays must have at least 3 elements and the same length")
end

if n == 3
if n <= 3
return x, y
else
# Find the point with the maximum distance from the line between the first and last points
Expand Down

0 comments on commit a6723a4

Please sign in to comment.