Expline v0.1.0 Expline

Expline is a GenServer that wraps the Expline.Spline module. It builds the Expline.Spline after being supplied the input parameters in start/3 or start_link/3. After initializing, use the interpolate/2 and interpolate/3 functions to find the corresponding points for each value you wish to interpolate.

For more information regarding the mathematics and performance of the spline building, read the Expline.Spline module documentation.

Summary

Functions

Interpolate a Expline.Spline.point/0 from its independent value

Builds a spline from the provided list of points and holds the state in a process without links (outside of a supervision tree)

Builds a spline from the provided list of points and holds the state in a process linked to the current process

Functions

interpolate(server, x, timeout \\ 5000)
interpolate(GenServer.server, float, timeout) ::
  {:ok, Expline.Spline.point} |
  {:error, Expline.Spline.interpolation_error}

Interpolate a Expline.Spline.point/0 from its independent value.

When an error arises with the interpolation, an error found in Expline.Spline.interpolation_error/0 will be returned.

start(points, opts \\ [])
start([Expline.Spline.point], GenServer.options) ::
  {:ok, pid} |
  {:error, {:already_started, pid}} |
  {:error, Expline.Spline.creation_error}

Builds a spline from the provided list of points and holds the state in a process without links (outside of a supervision tree).

See start_link/2 for more information.

start_link(points, opts \\ [])
start_link([Expline.Spline.point], GenServer.options) ::
  {:ok, pid} |
  {:error, {:already_started, pid}} |
  {:error, Expline.Spline.creation_error}

Builds a spline from the provided list of points and holds the state in a process linked to the current process.

This is often used to start the server process as part of a supervision tree.

Options and more information

See GenServer.start_link/3 for more information.