[{"name":"Bezier","comment":" Bézier (pronounced bez-E-ey) curves are super cool and commonly used in animation!\n\n[Here is an excellent video on them](https://www.youtube.com/watch?v=aVwxzDHniEw).\n\nThis module borrows a lot of code from [Elm Geometry](https://package.elm-lang.org/packages/ianmackenzie/elm-geometry), but is much more focused on animation needs for [Elm Animator](https://package.elm-lang.org/packages/mdgriffith/elm-animator).\n\n@docs fromPoints, Spline, Point, toPoints, standard\n\n@docs fromCatmullRom, toCatmullRom\n\n@docs atX, pointOn\n\n@docs first, controlOne, controlTwo, last\n\n@docs firstDerivative, secondDerivative\n\n@docs normalize, trace\n\n\n## Splitting\n\n@docs splitAt, splitAtX, splitList\n\n@docs takeBefore, takeAfter\n\n\n## Modification\n\n@docs scale, translateBy, withVelocities\n\n\n## Serialization\n\n@docs toPath, toCss\n\n","unions":[{"name":"Spline","comment":" ","args":[],"cases":[]}],"aliases":[{"name":"Point","comment":" ","args":[],"type":"{ x : Basics.Float, y : Basics.Float }"}],"values":[{"name":"atX","comment":" ","type":"Basics.Float -> Bezier.Spline -> { point : { x : Basics.Float, y : Basics.Float }, t : Basics.Float }"},{"name":"controlOne","comment":" ","type":"Bezier.Spline -> Bezier.Point"},{"name":"controlTwo","comment":" ","type":"Bezier.Spline -> Bezier.Point"},{"name":"first","comment":" ","type":"Bezier.Spline -> Bezier.Point"},{"name":"firstDerivative","comment":" ","type":"Bezier.Spline -> Bezier.Proportion -> Bezier.Point"},{"name":"fromCatmullRom","comment":" ","type":"Bezier.Point -> Bezier.Point -> Bezier.Point -> Bezier.Point -> Bezier.Spline"},{"name":"fromPoints","comment":" ","type":"Bezier.Point -> Bezier.Point -> Bezier.Point -> Bezier.Point -> Bezier.Spline"},{"name":"last","comment":" ","type":"Bezier.Spline -> Bezier.Point"},{"name":"normalize","comment":" Takes a bezier and normalizes it so that it goes from (0,0) to (1,1).\n","type":"Bezier.Spline -> Bezier.Spline"},{"name":"pointOn","comment":" Given a spline and a proportion, return the point on the spline at that proportion.\n","type":"Bezier.Spline -> Bezier.Proportion -> Bezier.Point"},{"name":"scale","comment":" ","type":"Basics.Float -> Bezier.Point -> Bezier.Point"},{"name":"secondDerivative","comment":" ","type":"Bezier.Spline -> Bezier.Proportion -> Bezier.Point"},{"name":"splitAt","comment":" Split a spline at a particular parameter value, resulting in two smaller splines.\n\nNote, this is _not_ the intuitive version you're thinking of.\n\n","type":"Basics.Float -> Bezier.Spline -> ( Bezier.Spline, Bezier.Spline )"},{"name":"splitAtX","comment":" ","type":"Basics.Float -> Bezier.Spline -> ( Bezier.Spline, Bezier.Spline )"},{"name":"splitList","comment":" ","type":"Basics.Float -> List.List Bezier.Spline -> { before : List.List Bezier.Spline, after : List.List Bezier.Spline }"},{"name":"standard","comment":" A very common Bézier curve that goes from (0,0) to (1,1) with control points at (0.4,0) and (0.2,1).\n\nThis is the standard transition curve for a lot of animation systems.\n\n","type":"Bezier.Spline"},{"name":"takeAfter","comment":" ","type":"Basics.Float -> List.List Bezier.Spline -> List.List Bezier.Spline"},{"name":"takeBefore","comment":" ","type":"Basics.Float -> List.List Bezier.Spline -> List.List Bezier.Spline"},{"name":"toCatmullRom","comment":" _Note_ This only approximates a Catmull-Rom spline, it won't successsfully round trip with `toCatmullRom` because the control points are lost.\n","type":"Bezier.Spline -> { one : Bezier.Point, two : Bezier.Point, three : Bezier.Point, four : Bezier.Point }"},{"name":"toCss","comment":" Normalize and render to a string that can be used in CSS\n\ne.g. cubic-bezier(0.1, 0.7, 1.0, 0.1)\n\n","type":"Bezier.Spline -> String.String"},{"name":"toPath","comment":" Render a spline to a string that can be used in SVG\n\ne.g. (M100,250 C100,100 400,100 400,250)\n\nThis uses absolute coordinates.\n\n","type":"Bezier.Spline -> String.String"},{"name":"toPoints","comment":" ","type":"Bezier.Spline -> { one : Bezier.Point, two : Bezier.Point, three : Bezier.Point, four : Bezier.Point }"},{"name":"trace","comment":" Trace out a curve by sampling it at regular intervals.\n\nReturn a list of splines that approximates the curve.\n\n","type":"{ toPoint : Basics.Float -> Bezier.Point, steps : Basics.Int, start : Basics.Float, end : Basics.Float } -> List.List Bezier.Spline"},{"name":"translateBy","comment":" ","type":"Bezier.Point -> Bezier.Point -> Bezier.Point"},{"name":"withVelocities","comment":" The math here comes the `fromEndpoints` constructor in elm-geometry\n\n<https://github.com/ianmackenzie/elm-geometry/blob/3.9.0/src/CubicSpline2d.elm#L174>\n\n","type":"Basics.Float -> Basics.Float -> Bezier.Spline -> Bezier.Spline"}],"binops":[]},{"name":"Bezier.Spring","comment":" Spring calculations!\n\nThis module really does 3 things.\n\n1.  Find a spring that will settle in a certain amount of time.\n2.  Calculate the position of an item at a certain time using a spring.\n3.  Calculate the Bezier segments that will approximate the spring motion.\n\n@docs Parameters, new\n\n\n# Preselected Springs\n\n@docs noWobble, gentle, wobbly, stiff\n\n@docs at, stepOver\n\n@docs settlesAt\n\n@docs segments\n\n","unions":[],"aliases":[{"name":"Parameters","comment":" The parameters that define a spring.\n\nCheck out the presets or `new` if you want some help constructing these values.\n\n","args":[],"type":"{ stiffness : Basics.Float, damping : Basics.Float, mass : Basics.Float }"}],"values":[{"name":"at","comment":"\n\n    Calculate the spring's current position and velocity given a spring, a duration, a target position, and an initial state.\n\n\n    Duration is in milliseconds. Initial and returned velocities are in position units per second.\n\n","type":"{ spring : Bezier.Spring.Parameters, target : Basics.Float, initial : { velocity : Basics.Float, position : Basics.Float } } -> Bezier.Spring.Duration -> { velocity : Basics.Float, position : Basics.Float }"},{"name":"gentle","comment":" ","type":"Bezier.Spring.Parameters"},{"name":"new","comment":" Normally when working with springs you have to choose a stiffness and a damping and they'll have seemingly arbitrary values like 216 or 14. This can be very hard to develop an intuition for!\n\nYour first option is to use one of the preselected springs.\n\nThe next option could be using this function.\n\nIt takes:\n\n  - `wobble` (0-1) - How wobbly you want the spring to be.\n  - `quickness` (0-1) - How quickly you want the spring to move.\n  - `settleMax` (ms) - The maximum time you want the spring to take to settle.\n\n","type":"{ wobble : Basics.Float, quickness : Basics.Float, settleMax : Basics.Float } -> Bezier.Spring.Parameters"},{"name":"noWobble","comment":" ","type":"Bezier.Spring.Parameters"},{"name":"segments","comment":" Given a spring, a starting position and velocity, and a target position, calculate the list of Bezier segments that will approximate the spring motion.\n\nThe segments' x coordinates are elapsed time in milliseconds, from zero to\n`settlesAt spring`. Their y coordinates are positions. Initial velocity is in\nposition units per second.\n\nThis assumes that the spring settles. The endpoint samples the spring at its\nestimated settling time; it is not forced to the exact target position.\n\n","type":"Bezier.Spring.Parameters -> { position : Basics.Float, velocity : Basics.Float } -> Basics.Float -> List.List Bezier.Spline"},{"name":"settlesAt","comment":" We can detect when a spring will settle if it is underdamped (meaning it oscillates before resting).\n<https://en.wikipedia.org/wiki/Settling_time>\n\nHowever for critically and overdamped systems it gets a lot more complicated.\nFortunately, I'm not sure that that's an issue as I don't think we want to model overdamped spring systems for animation.\n<https://electronics.stackexchange.com/questions/296567/over-and-critically-damped-systems-settling-time>\n\n","type":"Bezier.Spring.Parameters -> Basics.Float"},{"name":"stepOver","comment":" Iteratively step through a spring to get the final position and velocity.\n\n[`at`](#at) is faster, but possibly less accurate?\n\n","type":"{ spring : Bezier.Spring.Parameters, target : Basics.Float, stepSize : Basics.Float, initial : { velocity : Basics.Float, position : Basics.Float } } -> Basics.Float -> { velocity : Basics.Float, position : Basics.Float }"},{"name":"stiff","comment":" ","type":"Bezier.Spring.Parameters"},{"name":"wobbly","comment":" ","type":"Bezier.Spring.Parameters"}],"binops":[]}]