Point

namespace ezgl

A library for creating a graphical user interface.

class point2d
#include <point.hpp>

Represents a two-dimensional point.

Public Functions

inline point2d()

Default constructor: Create a point at (0, 0).

inline point2d(double x_coord, double y_coord) noexcept

Create a point at the given x and y position.

Public Members

double x = 0.0

Location of the x-coordinate.

double y = 0.0

Location of the y-coordinate.

Friends

inline friend bool operator==(point2d const &lhs, point2d const &rhs)

Test for equality.

inline friend bool operator!=(point2d const &lhs, point2d const &rhs)

Test for inequality.

inline friend point2d operator+(point2d const &lhs, point2d const &rhs)

Create a new point that is the sum of two points.

inline friend point2d &operator+=(point2d &lhs, point2d const &rhs)

Add one point to another point.

inline friend point2d operator-(point2d const &lhs, point2d const &rhs)

Create a new point that is the difference of two points.

inline friend point2d &operator-=(point2d &lhs, point2d const &rhs)

Subtract one point from another point.

inline friend point2d operator*(point2d const &lhs, point2d const &rhs)

Create a new point that is the product of two points.

inline friend point2d &operator*=(point2d &lhs, point2d const &rhs)

Multiply one point with another point.