Skip to content

Commit

Permalink
Merge pull request diagrams#336 from bacchanalia/docfix
Browse files Browse the repository at this point in the history
fix doc bug introduced in 418b3b7
  • Loading branch information
byorgey authored Apr 8, 2019
2 parents 30d06d9 + 45769f4 commit 9a1b0a3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Diagrams/Trail.hs
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,16 @@ splitAtParam' (SegTree t) p
| pParam == 1 = (before |> seg , after)
| otherwise = (before |> segL, segR <| after)
-- section uses rescale to find the new value of p1 after the split at p2
rescale u | pSegs' == uSegs = (uSegs + uParam / pParam' {-^1-}) / (pSegs' + 1) {-^2-}
| otherwise = u * tSegs / (pSegs' + 1) {-^3-}
rescale u | pSegs' == uSegs = (uSegs + uParam / pParam' {-'1-}) / (pSegs' + 1) {-'2-}
| otherwise = u * tSegs / (pSegs' + 1) {-'3-}
where
-- param 0 on a segment is param 1 on the previous segment
(pSegs', pParam') | pParam == 0 = (pSegs-1, 1)
| otherwise = (pSegs , pParam)
(uSegs , uParam ) = splitParam u
-- ^1 (pParam ≠ 0 → pParam' = pParam) ∧ (pParam = 0 → pParam' = 1) → pParam' ≠ 0
-- ^2 uSegs ≥ 0 ∧ pSegs' = uSegs → pSegs' ≥ 0 → pSegs' + 1 > 0
-- ^3 pSegs' + 1 = 0 → pSegs' = -1 → pSegs = 0 ∧ pParam = 0 → p = 0
-- '1 (pParam ≠ 0 → pParam' = pParam) ∧ (pParam = 0 → pParam' = 1) → pParam' ≠ 0
-- '2 uSegs ≥ 0 ∧ pSegs' = uSegs → pSegs' ≥ 0 → pSegs' + 1 > 0
-- '3 pSegs' + 1 = 0 → pSegs' = -1 → pSegs = 0 ∧ pParam = 0 → p = 0
-- → rescale is not called

instance (Metric v, OrderedField n, Real n) => Sectionable (SegTree v n) where
Expand Down

0 comments on commit 9a1b0a3

Please sign in to comment.