Point

class CPoint

Describes a 2D point.

Public Functions

CPoint() = default

Default constructor.

inline CPoint(double _x, double _y)

Creates a point with default value.

Parameters
  • _x – X-value of the point.

  • _y – Y-value of the point.

inline double operator[](size_t _i) const

Returns value with the given index.

Index may be 0 or 1, otherwise std::out_of_range exception is thrown.

Parameters

_i – Index.

Returns

Target value.

inline double &operator[](size_t _i)

Returns reference to value with the given index.

Index may be 0 or 1, otherwise std::out_of_range exception is thrown.

Parameters

_i – Index.

Returns

Returns to target value.

Public Members

double x = 0.0

X-value.

double y = 0.0

Y-value.

Public Static Functions

static inline size_t Size()

Number of values in the point.

Returns

2.