{- ORMOLU_DISABLE -}
-- Implicit CAD. Copyright (C) 2011, Christopher Olah (chris@colah.ca)
-- Copyright (C) 2016 Julia Longtin (julial@turinglace.com)
-- Released under the GNU AGPLV3+, see LICENSE

module Graphics.Implicit.Export.Symbolic.Rebound2 (rebound2) where

import Graphics.Implicit.Definitions (BoxedObj2, ℝ2)

import Prelude ((+), (-))
import Linear ((^/))

-- | Slightly stretch the bounding box of an object, in order to
--   ensure that during mesh generation, there are no problems because
--   values are right at the edge.
rebound2 :: BoxedObj2 -> BoxedObj2
rebound2 :: BoxedObj2 -> BoxedObj2
rebound2 (Obj2
obj, (V2 ℝ
a,V2 ℝ
b)) =
    let
        d :: ℝ2
        d :: V2 ℝ
d = (V2 ℝ
b forall a. Num a => a -> a -> a
- V2 ℝ
a) forall (f :: * -> *) a.
(Functor f, Fractional a) =>
f a -> a -> f a
^/ 10
    in
        (Obj2
obj, (V2 ℝ
a forall a. Num a => a -> a -> a
- V2 ℝ
d, V2 ℝ
b forall a. Num a => a -> a -> a
+ V2 ℝ
d))