geometrex v0.1.1 Point
This module uses two-dimentional coordinates in Cartesian coordinate system.
Link to this section Summary
Types
Type that represents Point struct with :x and :y as number.
Pointを表す型は:xを数値型、:yを数値型として取る構造体を表す。
Functions
new vector from two number
Examples
iex> Point.new(1, 1)
%Point{x: 1, y: 1}
new vector from two vector and sort. output a is near by origin than b.
Examples
iex> Point.new_sort( Point.new(1, 0), Point.new(0, 0))
[%Point{x: 0, y: 0}, %Point{x: 1, y: 0}]
Calculate Vector from two vector
Calculate norum of “one” vector
Calculate norum of “two” vector
Subtract Vector from two vector
Link to this section Types
Type that represents Point struct with :x and :y as number.
Pointを表す型は:xを数値型、:yを数値型として取る構造体を表す。
Link to this section Functions
new vector from two vector and sort. output a is near by origin than b.
Examples
iex> Point.new_sort( Point.new(1, 0), Point.new(0, 0))
[%Point{x: 0, y: 0}, %Point{x: 1, y: 0}]
Calculate Vector from two vector.
Examples
iex> Point.new_vector( %Point{x: 2, y: 2}, %Point{x: 1, y: 1} )
%Point{x: 1, y: 1}
Calculate norum of “two” vector
Examples
iex> Point.nrm(Point.new(0, 0), Point.new(1, 1))
1.4142135623730951