Shortcuts for quickly getting a list of points that can be passed into Curves.define_bezier/1
Usage
iex> alias Curves.Bezier.Predefined
iex> Predefined.get_coords(:linear_up_right)
[{0, 0}, {1, 1}]
iex> [:ease | _] = Predefined.list()
iex> Predefined.get_coords(:ease_in_out_cubic)
[{0.0, 0.0}, {0.65, 0.0}, {0.35, 1.0}, {1.0, 1.0}]
Summary
Functions
Return a map with details about a specific curve.
Return coordinates list for a given key
Return a list of all keys that can be used with get_coords/1
Return a list of all keys, within a given curve order, that can be used with get_coords/1
(linear = 1, quadratic = 2, cubic = 3)
Return list of all details for all predefined curves
Types
@type curve_key() :: atom()
Cubic
:ease, :ease_in, :ease_out, :ease_in_out, :ease_in_back, :ease_in_circ, :ease_in_cubic, :ease_in_expo, :ease_in_quad, :ease_in_quart, :ease_in_quint, :ease_in_sine, :ease_out_back, :ease_out_circ, :ease_out_cubic, :ease_out_expo, :ease_out_quad, :ease_out_quart, :ease_out_quint, :ease_out_sine, :ease_in_out_back, :ease_in_out_circ, :ease_in_out_cubic, :ease_in_out_expo, :ease_in_out_quad, :ease_in_out_quart, :ease_in_out_quint, :ease_in_out_sine
Quadratic
:quadratic_up, :quadratic_down, :quadratic_left, :quadratic_right
Linear
:linear, :linear_up_right, :linear_down_right, :linear_horizontal, :linear_vertical
@type curve_keys() :: [curve_key()]
A list of curve keys
@type curve_type_info() :: %{ order: Curves.Utils.Types.order(), key: curve_key(), points: Curves.Utils.Types.point_list() }
A map of useful info about a predefined curve.
@type curve_type_infos() :: [curve_type_info()]
A list of curve type info
Functions
@spec details(curve_key()) :: curve_type_info()
Return a map with details about a specific curve.
Examples
iex> Curves.Bezier.Predefined.details(:linear_up_right)
%{k: :linear_up_right, points: , order: 1}
@spec get_coords(curve_key()) :: Curves.Utils.Types.point_list()
Return coordinates list for a given key
@spec list() :: curve_keys()
Return a list of all keys that can be used with get_coords/1
Examples
iex> [:ease | _] = Curves.Bezier.Predefined.list()
@spec list(Curves.Utils.Types.order() | :linear | :quad | :cubic) :: curve_keys()
Return a list of all keys, within a given curve order, that can be used with get_coords/1
(linear = 1, quadratic = 2, cubic = 3)
alternately, pass in one of :linear, :quad, :cubic.
Examples
iex> [:linear | _] = Curves.Bezier.Predefined.list(1)
iex> [:quadratic_down | _] = Curves.Bezier.Predefined.list(2)
@spec list_details() :: [curve_type_info()]
Return list of all details for all predefined curves