View Source Scenic.Math (Scenic v0.11.2)

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

@type line() :: {p0 :: point(), p1 :: point()}
@type matrix() :: binary()
@type matrix_list() :: [number()]
@type point() :: {x :: number(), y :: number()}
@type quad() :: {p0 :: point(), p1 :: point(), p2 :: point(), p3 :: point()}
@type triangle() :: {p0 :: point(), p1 :: point(), p2 :: point()}
@type vector_2() :: {x :: number(), y :: number()}