module Diagrams.TwoD.Deform where
import Control.Lens
import Diagrams.Deform
import Linear.V2
import Linear.Vector
parallelX0 :: (R1 v, Num n) => Deformation v v n
parallelX0 :: forall (v :: * -> *) n. (R1 v, Num n) => Deformation v v n
parallelX0 = forall (v :: * -> *) (u :: * -> *) n.
(Point v n -> Point u n) -> Deformation v u n
Deformation (forall (t :: * -> *) a. R1 t => Lens' (t a) a
_x forall s t a b. ASetter s t a b -> b -> s -> t
.~ n
0)
perspectiveX1 :: (R1 v, Functor v, Fractional n) => Deformation v v n
perspectiveX1 :: forall (v :: * -> *) n.
(R1 v, Functor v, Fractional n) =>
Deformation v v n
perspectiveX1 = forall (v :: * -> *) (u :: * -> *) n.
(Point v n -> Point u n) -> Deformation v u n
Deformation forall a b. (a -> b) -> a -> b
$ \Point v n
p -> Point v n
p forall (f :: * -> *) a.
(Functor f, Fractional a) =>
f a -> a -> f a
^/ (Point v n
p forall s a. s -> Getting a s a -> a
^. forall (t :: * -> *) a. R1 t => Lens' (t a) a
_x)
parallelY0 :: (R2 v, Num n) => Deformation v v n
parallelY0 :: forall (v :: * -> *) n. (R2 v, Num n) => Deformation v v n
parallelY0 = forall (v :: * -> *) (u :: * -> *) n.
(Point v n -> Point u n) -> Deformation v u n
Deformation (forall (t :: * -> *) a. R2 t => Lens' (t a) a
_y forall s t a b. ASetter s t a b -> b -> s -> t
.~ n
0)
perspectiveY1 :: (R2 v, Functor v, Floating n) => Deformation v v n
perspectiveY1 :: forall (v :: * -> *) n.
(R2 v, Functor v, Floating n) =>
Deformation v v n
perspectiveY1 = forall (v :: * -> *) (u :: * -> *) n.
(Point v n -> Point u n) -> Deformation v u n
Deformation forall a b. (a -> b) -> a -> b
$ \Point v n
p -> Point v n
p forall (f :: * -> *) a.
(Functor f, Fractional a) =>
f a -> a -> f a
^/ (Point v n
p forall s a. s -> Getting a s a -> a
^. forall (t :: * -> *) a. R2 t => Lens' (t a) a
_y)
facingX :: (R1 v, Functor v, Fractional n) => Deformation v v n
facingX :: forall (v :: * -> *) n.
(R1 v, Functor v, Fractional n) =>
Deformation v v n
facingX = forall (v :: * -> *) (u :: * -> *) n.
(Point v n -> Point u n) -> Deformation v u n
Deformation forall a b. (a -> b) -> a -> b
$
\Point v n
p -> let x :: n
x = Point v n
p forall s a. s -> Getting a s a -> a
^. forall (t :: * -> *) a. R1 t => Lens' (t a) a
_x
in Point v n
p forall (f :: * -> *) a.
(Functor f, Fractional a) =>
f a -> a -> f a
^/ n
x forall a b. a -> (a -> b) -> b
& forall (t :: * -> *) a. R1 t => Lens' (t a) a
_x forall s t a b. ASetter s t a b -> b -> s -> t
.~ n
x
facingY :: (R2 v, Functor v, Fractional n) => Deformation v v n
facingY :: forall (v :: * -> *) n.
(R2 v, Functor v, Fractional n) =>
Deformation v v n
facingY = forall (v :: * -> *) (u :: * -> *) n.
(Point v n -> Point u n) -> Deformation v u n
Deformation forall a b. (a -> b) -> a -> b
$
\Point v n
p -> let y :: n
y = Point v n
p forall s a. s -> Getting a s a -> a
^. forall (t :: * -> *) a. R2 t => Lens' (t a) a
_y
in Point v n
p forall (f :: * -> *) a.
(Functor f, Fractional a) =>
f a -> a -> f a
^/ n
y forall a b. a -> (a -> b) -> b
& forall (t :: * -> *) a. R2 t => Lens' (t a) a
_y forall s t a b. ASetter s t a b -> b -> s -> t
.~ n
y