122 double dot(
const Point& other)
const;
2D point with high-precision coordinates and utility methods
bool operator==(const Point &other) const
Equality operator with tolerance.
double cross(const Point &other) const
Calculate cross product magnitude (2D cross product)
Point & operator=(const Point &other)=default
Assignment operator.
Point normalize() const
Normalize vector to unit length.
std::string to_string() const
Get string representation.
double magnitude() const
Calculate vector magnitude (length)
Point & operator+=(const Point &other)
Addition assignment.
Point operator/(double scalar) const
Scalar division.
double distance_squared_to(const Point &other) const
Calculate squared distance (faster, avoids sqrt)
Point operator-(const Point &other) const
Subtraction operator.
double distance_to_line(const Point &line_start, const Point &line_end) const
Calculate distance from this point to a line segment.
Point rotate_around(const Point ¢er, double angle) const
Rotate point around another point by angle (radians)
friend std::ostream & operator<<(std::ostream &os, const Point &point)
Stream output operator.
Point & operator-=(const Point &other)
Subtraction assignment.
Point rotate(double angle) const
Rotate point around origin by angle (radians)
static constexpr double TOLERANCE
Default precision tolerance for floating point comparisons.
Point(double x, double y)
Constructor with coordinates.
bool operator!=(const Point &other) const
Inequality operator.
double magnitude_squared() const
Calculate squared magnitude (faster, avoids sqrt)
double dot(const Point &other) const
Calculate dot product with another point (as vector)
double angle_to(const Point &other) const
Calculate angle from this point to another (radians)
Point(const Point &other)=default
Copy constructor.
Point operator+(const Point &other) const
Addition operator.
double distance_to(const Point &other) const
Calculate Euclidean distance to another point.
Point()
Default constructor - creates point at origin.
Point operator*(double scalar) const
Scalar multiplication.
bool is_zero() const
Check if point is approximately zero.
Point midpoint(const Point &p1, const Point &p2)
Calculate midpoint between two points.
int orientation(const Point &p1, const Point &p2, const Point &p3)
Calculate orientation of three points.
double distance(const Point &p1, const Point &p2)
Calculate distance between two points.
bool are_collinear(const Point &p1, const Point &p2, const Point &p3)
Check if three points are collinear.
double angle_between_points(const Point &p1, const Point &p2, const Point &p3)
Calculate angle between three points (p1-p2-p3)
Main namespace for ZLayout library.
Hash function for Point (for use in std::unordered_map, etc.)
std::size_t operator()(const Point &point) const