32 Point(
float x_,
float y_) : x(x_), y(y_),
z(0) {}
42 Point(
float x_,
float y_,
float z_) : x(x_), y(y_),
z(z_) {}
65 Point operator*(
float scalar)
const;
66 Point operator/(
float scalar)
const;
68 bool operator==(
const Point& other)
const;
69 void operator+=(
const Point& other);
70 void operator/=(
float scalar);
71 void operator*=(
float scalar);
73 float dot(
const Point& other)
const;
A struct representing a point in 3D space.
Definition point.h:15
friend std::ostream & operator<<(std::ostream &os, const Point &point)
Overload the << operator to print the point's coordinates.
Definition point.cpp:66
float z
Coordinates of the point.
Definition point.h:16
Point()
Construct a new Point object at the origin.
Definition point.h:23
float length() const
Calculate the length of the vector from the origin to this point.
Definition point.cpp:5
Point(float x_, float y_)
Construct a new Point object at the specified coordinates (z defaults to 0)
Definition point.h:32
float distance(const Point &other) const
Calculate the distance between this point and another point.
Definition point.cpp:10
Point(float x_, float y_, float z_)
Construct a new Point object at the specified coordinates.
Definition point.h:42