View Source Geometry.Point (Geometry v0.4.0)
A point struct, representing a 2D point.
Link to this section Summary
Functions
Creates an empty Point.
Creates a Point from the given coordinate.
Creates a Point from the given x and y.
Link to this section Types
@type t() :: %Geometry.Point{coordinate: Geometry.coordinate() | []}
Link to this section Functions
@spec new() :: t()
Creates an empty Point.
examples
Examples
iex> Point.new()
%Point{coordinate: []}
@spec new(Geometry.coordinate()) :: t()
Creates a Point from the given coordinate.
examples
Examples
iex> Point.new([1.5, -2.1])
%Point{coordinate: [1.5, -2.1]}
Creates a Point from the given x and y.
examples
Examples
iex> Point.new(-1.1, 2.2)
%Point{coordinate: [-1.1, 2.2]}