Scenic.Math (Scenic v0.10.3) View Source

Helper functions that support Scenic mathematical operations.

The math functions are fairly straightforward. When performance is needed some have been broken out into a NIF.

The NIF functions are currently written for compatibility over top speed and as such, there is an opportunity to further improve them by calling out to CPU-specific vector instructions in the future.

Link to this section Summary

Link to this section Types

Specs

line() :: {p0 :: point(), p1 :: point()}

Specs

matrix() :: binary()

Specs

matrix_list() :: [number()]

Specs

point() :: {x :: number(), y :: number()}

Specs

quad() :: {p0 :: point(), p1 :: point(), p2 :: point(), p3 :: point()}

Specs

triangle() :: {p0 :: point(), p1 :: point(), p2 :: point()}

Specs

vector_2() :: {x :: number(), y :: number()}