Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parametric function for Chain #1155

Merged
merged 15 commits into from
Dec 19, 2024
Prev Previous commit
Next Next commit
fix
JoshuaLampert committed Dec 18, 2024
commit fbaaed58e4b8e582f666c916599f2f30ffcd3cdf
4 changes: 2 additions & 2 deletions src/geometries/polytopes.jl
Original file line number Diff line number Diff line change
@@ -161,9 +161,9 @@ function (c::Chain)(t)
throw(DomainError(t, "c(t) is not defined for t outside [0, 1]."))
end
n = nvertices(c) - !isclosed(c)
k = max(1, ceil(Int, n * t))
k = min(n - 1, floor(Int, n * t))
s, _ = iterate(segments(c), k)
s(n * t - k + 1)
s(n * t - k)
end

# implementations of Chain