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
Types
The type of curve
A list of curve keys
A map of useful info about a predefined curve.
A list of curve type info
Functions
Return a map with details about a specific curve.
Return a tensor of points for a given key. Mainly for internal use.
Return coordinates list for a given key
Return a list of all keys, within a given curve order, that can be used with get/2
(linear = 1, quadratic = 2, cubic = 3)
Return list of all details for all predefined curves
Types
@type curve_key() :: atom()
The type of curve
@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(curve_key(), Curves.Utils.Types.opts()) :: Curves.Utils.Types.points()
Return a tensor of points for a given key. Mainly for internal use.
@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/2
Examples
iex> [:ease | _] = Curves.Bezier.Predefined.list()
@spec list(Curves.Utils.Types.order()) :: curve_keys()
Return a list of all keys, within a given curve order, that can be used with get/2
(linear = 1, quadratic = 2, cubic = 3)
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