19 #ifndef EZGL_POINT_HPP
20 #define EZGL_POINT_HPP
39 point2d(
double x_coord,
double y_coord) :
x(x_coord),
y(y_coord)
58 return (lhs.
x == rhs.
x) && (lhs.
y == rhs.
y);
74 return {lhs.
x + rhs.
x, lhs.
y + rhs.
y};
93 return {lhs.
x - rhs.
x, lhs.
y - rhs.
y};
112 return {lhs.
x * rhs.
x, lhs.
y * rhs.
y};
Represents a two-dimensional point.
Definition: point.hpp:27
point2d()
Default constructor: Create a point at (0, 0).
Definition: point.hpp:32
double y
Location of the y-coordinate.
Definition: point.hpp:51
friend bool operator==(point2d const &lhs, point2d const &rhs)
Test for equality.
Definition: point.hpp:56
double x
Location of the x-coordinate.
Definition: point.hpp:46
friend point2d operator-(point2d const &lhs, point2d const &rhs)
Create a new point that is the difference of two points.
Definition: point.hpp:91
friend point2d & operator*=(point2d &lhs, point2d const &rhs)
Multiply one point with another point.
Definition: point.hpp:118
friend point2d & operator+=(point2d &lhs, point2d const &rhs)
Add one point to another point.
Definition: point.hpp:80
friend point2d & operator-=(point2d &lhs, point2d const &rhs)
Subtract one point from another point.
Definition: point.hpp:99
friend point2d operator*(point2d const &lhs, point2d const &rhs)
Create a new point that is the product of two points.
Definition: point.hpp:110
point2d(double x_coord, double y_coord)
Create a point at the given x and y position.
Definition: point.hpp:39
friend point2d operator+(point2d const &lhs, point2d const &rhs)
Create a new point that is the sum of two points.
Definition: point.hpp:72
friend bool operator!=(point2d const &lhs, point2d const &rhs)
Test for inequality.
Definition: point.hpp:64
A library for creating a graphical user interface.
Definition: application.hpp:40