Refactor window block
This commit is contained in:
@@ -299,6 +299,16 @@ divideLine x a b = take 5000 $ map (\i -> a +.+ (i / (fromIntegral numPoints) *.
|
||||
numPoints = max 1 $ ceiling $ d / x
|
||||
ns = [0 .. numPoints]
|
||||
|
||||
divideLineOddNumPoints :: Float -> Point2 -> Point2 -> [Point2]
|
||||
--divideLine x a b = map (\i -> a +.+ (i / (fromIntegral numPoints)) *.* (b -.- a))
|
||||
divideLineOddNumPoints x a b = take 5000 $ map (\i -> a +.+ (i / (fromIntegral numPoints) *.* (b -.- a)) )
|
||||
$ map fromIntegral ns
|
||||
where d = dist a b
|
||||
numPoints' = max 1 $ ceiling $ d / x
|
||||
numPoints | even numPoints' = numPoints'
|
||||
| otherwise = numPoints' + 1
|
||||
ns = [0 .. numPoints]
|
||||
|
||||
|
||||
-- pulled the following from the haskell wiki
|
||||
-- it seems to produce an infinite loop sometimes
|
||||
|
||||
Reference in New Issue
Block a user