stella v0.4.0 Isometric
Documentation for Isometric
.
Link to this section Summary
Functions
Projects 2D/3D carthesian coordinates to 2D isometric coordinates. The X axis goes from top-left to bottom-right. The Y axis goes from top-right to bottom-left. The Z axis goes straight up.
Convert string to point (2D or 3D)
Convert point to string
Convert string to point (2D or 3D)
Convert coorddinates to string
Convert coorddinates to string
Link to this section Functions
Link to this function
convert_cartesian_to_isometric(x, y, z \\ 0)
Projects 2D/3D carthesian coordinates to 2D isometric coordinates. The X axis goes from top-left to bottom-right. The Y axis goes from top-right to bottom-left. The Z axis goes straight up.
Examples
iex> Isometric.convert_cartesian_to_isometric(1, 2)
%{x: -1, y: 1.5}
Link to this function
distance_between(point_a, point_b)
Convert string to point (2D or 3D)
Examples
iex> Isometric.distance_between(%{x: -1, y: 2}, %{x: 1, y: 2})
2
iex> Isometric.distance_between(%{x: -91, y: -20}, %{x: -10, y: 2})
103
Link to this function
point_to_string(point)
Convert point to string
Examples
iex> Isometric.point_to_string(%{x: 1, y: 2, z: 3})
"x: 1, y: 2, z: 3"
Link to this function
string_to_point(string)
Convert string to point (2D or 3D)
Examples
iex> Isometric.string_to_point("x: 1, y: 2, z: 3")
%{x: 1, y: 2, z: 3}
Link to this function
to_string(x, y)
Convert coorddinates to string
Examples
iex> Isometric.to_string(1, 2)
"x: 1, y: 2"
Link to this function
to_string(x, y, z)
Convert coorddinates to string
Examples
iex> Isometric.to_string(1, 2, 3)
"x: 1, y: 2, z: 3"