# HG changeset patch # User Simon Heath # Date 1715865695 14400 # Thu May 16 09:21:35 2024 -0400 # Node ID c4f86eecbdfe3aece959623b7f524db15ead7b2d # Parent 4548959d3a2fc9fe21152602d53b38967b449666 Playin' with Matrex diff --git a/apps/tfex/lib/tf.ex b/apps/tfex/lib/tf.ex new file mode 100644 --- /dev/null +++ b/apps/tfex/lib/tf.ex @@ -0,0 +1,4 @@ +defmodule Tfex.Tf do + @moduledoc "Struct for a transform, defaulting to Local Tangent Plane" + defstruct id: :ltp, transform: Tfex.id() +end diff --git a/apps/tfex/lib/tfex.ex b/apps/tfex/lib/tfex.ex new file mode 100644 --- /dev/null +++ b/apps/tfex/lib/tfex.ex @@ -0,0 +1,37 @@ +defmodule Tfex do + @moduledoc """ + Documentation for `Tfex`. + """ + + @doc """ + Hello world. + + ## Examples + + iex> Tfex.hello() + :world + + """ + def hello do + :world + end + + @doc "Return vector3 for position" + def vec3(x,y,z) do + Matrex.new([[x,y,z]]) + end + + @doc "Return identity transform matrix." + def id() do + Matrex.eye(3) + end + + @doc "Create a translation matrix from the vector v" + def translation(v) do + end + + @doc "Create a rotation matrix from the vector v -- oh fucking hell quaternions" + def rotation(v) do + end + +end