-
Notifications
You must be signed in to change notification settings - Fork 62
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
section on trail producing incorrect result when upper param is >= 1 (domainUpper) #329
Comments
This can be fixed narrowly by changing (>=) to (>) here, but the p > 0 case is still wrong. I've eyeballed some outputs for the p < 0 and they look plausible. |
The equation on line 241 looks wrong to me: diagrams-lib/src/Diagrams/Trail.hs Line 241 in 7ff9922
|
On 243, I think the lambda should be id, since the number of segments doesn't change, but that doesn't completely fix it, so maybe an issue on 241 also. diagrams-lib/src/Diagrams/Trail.hs Line 243 in 7ff9922
|
I think 241 is more naturally expressed as 1 + (p - 1)*tsegs, but I think it's correct. I think 243 is only id when u corresponds to a previous segment, and in the case it's on the same segment it needs to be rescaled. |
section on trail producing incorrect result when upper param is >= 1 (domainUpper) diagrams#329 The first parameter was not being rescaled properly in the case that the second parameter was >= 1. The old code tried to rescale as though an extra segment was added, while what the code actually does is replace the last segment with a longer one. This leads two two cases, either the first param is on a previous segment and doesn't need to change or it's on the last segment and has to be rescaled to the new length.
Ah, yes, I was reading the code wrong. I can make sense of 241 now. |
I want to rewrite sectionAtParam' for more clarity. Right now it returns ((Segtree v n, n -> n), (Segtree v n, n -> n)) but the second (n -> n) which represents the reparamaterization of the second tree is never used. Is there any reason to keep that code? |
The uses I can think of would be fine with sectionA x t1 t2 = let ((a,fa),_) = splitAtParam' x t2 in snd $ splitAtParam a (fa t1)
sectionB x t1 t2 = let (_,(b,fb)) = splitAtParam' x t1 in fst $ splitAtParam b (fb t2)
prop_section x t1 t2 = sectionA x t1 t2 =~= sectionB x t1 t2 For some appropriate |
In order to have that test we'd need to export splitAtParam', which I'm not sure is worth doing just to have that test. |
bug fix: #329 section on trail producing incorr...
Red sections should be equal to green sections.
The text was updated successfully, but these errors were encountered: