15 constexpr
CVector(
float xCoord,
float yCoord):x(xCoord), y(yCoord) {}
17 constexpr CVector operator+(
const CVector &other)
const 19 return CVector(x + other.x, y + other.y);
22 constexpr CVector operator-(
const CVector &other)
const 24 return CVector(x - other.x, y - other.y);
27 CVector& operator+=(
const CVector &other);
28 CVector& operator-=(
const CVector &other);
30 constexpr
float scalar(
const CVector &other)
const 32 return x * other.x + y * other.y;