stella v0.6.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)

Specs

convert_cartesian_to_isometric(number(), number(), number()) :: %{
  x: number(),
  y: float()
}

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)

Specs

distance_between(map(), map()) :: number()

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)

Specs

point_to_string(map()) :: <<_::64, _::_*8>>

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)

Specs

string_to_point(binary()) :: map()

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)

Specs

to_string(number(), number()) :: <<_::64, _::_*8>>

Convert coorddinates to string

Examples

iex> Isometric.to_string(1, 2)
"x: 1, y: 2"
Link to this function

to_string(x, y, z)

Specs

to_string(number(), number(), number()) :: <<_::64, _::_*8>>

Convert coorddinates to string

Examples

iex> Isometric.to_string(1, 2, 3)
"x: 1, y: 2, z: 3"

iex> Isometric.to_string(1, 2, 3)
"x: 1, y: 2, z: 3"