eckit::geo::Point2 class final

The Point2 class.

A point on two-dimensional space, in (X, Y) coordinates, linear in space.

Public types

using container_type = array

Public static variables

static size_t DIMS constexpr
static value_type EPS constexpr

Public static functions

static auto dimensions() -> size_t
static auto norm(const Point2& p) -> value_type
static auto normalize(const Point2& p) -> Point2
static auto middle(const Point2& p, const Point2& q) -> Point2
static auto distance(const Point2& p, const Point2& q, size_t axis) -> value_type
static auto distance(const Point2& p, const Point2& q) -> value_type
static auto distance2(const Point2& p, const Point2& q) -> value_type

Constructors, destructors, conversion operators

Point2()
Point2(value_type x, value_type y)
Point2(const Point2& other)
Point2(Point2&& other)
~Point2() defaulted

Public functions

auto operator=(const Point2& other) -> Point2&
auto operator=(Point2&& other) -> Point2&
auto norm() const -> value_type
auto normalize() const -> Point2
auto middle(const Point2&) const -> Point2
auto distance(const Point2&, size_t axis) const -> value_type
auto distance(const Point2&) const -> value_type
auto distance2(const Point2&) const -> value_type
auto x(size_t axis) const -> value_type

Public variables

const value_type& X
const value_type& Y

Friends

auto operator<<(std::ostream& out, const Point2& p) -> std::ostream&
auto operator-(const Point2& p, const Point2& q) -> Point2
auto operator+(const Point2& p, const Point2& q) -> Point2
auto operator*(const Point2& p, value_type d) -> Point2
auto operator==(const Point2& p, const Point2& q) -> bool
auto operator!=(const Point2& p, const Point2& q) -> bool