|
ZLayout EDA Library v1.0.0
Advanced Electronic Design Automation Layout Library with Bilingual Documentation
|
2D point with high-precision coordinates and utility methods More...
#include <point.hpp>
Public Member Functions | |
| Point () | |
| Default constructor - creates point at origin. | |
| Point (double x, double y) | |
| Constructor with coordinates. | |
| Point (const Point &other)=default | |
| Copy constructor. | |
| Point & | operator= (const Point &other)=default |
| Assignment operator. | |
| bool | operator== (const Point &other) const |
| Equality operator with tolerance. | |
| bool | operator!= (const Point &other) const |
| Inequality operator. | |
| Point | operator+ (const Point &other) const |
| Addition operator. | |
| Point | operator- (const Point &other) const |
| Subtraction operator. | |
| Point | operator* (double scalar) const |
| Scalar multiplication. | |
| Point | operator/ (double scalar) const |
| Scalar division. | |
| Point & | operator+= (const Point &other) |
| Addition assignment. | |
| Point & | operator-= (const Point &other) |
| Subtraction assignment. | |
| double | distance_to (const Point &other) const |
| Calculate Euclidean distance to another point. | |
| double | distance_squared_to (const Point &other) const |
| Calculate squared distance (faster, avoids sqrt) | |
| double | distance_to_line (const Point &line_start, const Point &line_end) const |
| Calculate distance from this point to a line segment. | |
| double | dot (const Point &other) const |
| Calculate dot product with another point (as vector) | |
| double | cross (const Point &other) const |
| Calculate cross product magnitude (2D cross product) | |
| double | magnitude () const |
| Calculate vector magnitude (length) | |
| double | magnitude_squared () const |
| Calculate squared magnitude (faster, avoids sqrt) | |
| Point | normalize () const |
| Normalize vector to unit length. | |
| Point | rotate (double angle) const |
| Rotate point around origin by angle (radians) | |
| Point | rotate_around (const Point ¢er, double angle) const |
| Rotate point around another point by angle (radians) | |
| double | angle_to (const Point &other) const |
| Calculate angle from this point to another (radians) | |
| bool | is_zero () const |
| Check if point is approximately zero. | |
| std::string | to_string () const |
| Get string representation. | |
| __init__ (self, float x, float y) | |
| str | __repr__ (self) |
| bool | __eq__ (self, other) |
| int | __hash__ (self) |
| float | distance_to (self, 'Point' other) |
| float | distance_to_line (self, 'Point' line_start, 'Point' line_end) |
| to_numpy (self) | |
Public Attributes | |
| double | x |
| X coordinate. | |
| double | y |
| Y coordinate. | |
| x = float(x) | |
| y = float(y) | |
Static Public Attributes | |
| static constexpr double | TOLERANCE = 1e-10 |
| Default precision tolerance for floating point comparisons. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Point &point) |
| Stream output operator. | |
2D point with high-precision coordinates and utility methods
2D point with coordinates and utility methods.
Represents a point in 2D space with double precision coordinates. Provides distance calculations, geometric operations, and tolerance-based equality comparisons suitable for EDA applications.
|
inline |
|
inline |
|
default |
Copy constructor.
| zlayout.geometry.Point.__init__ | ( | self, | |
| float | x, | ||
| float | y ) |
Definition at line 19 of file geometry.py.
| bool zlayout.geometry.Point.__eq__ | ( | self, | |
| other ) |
Definition at line 29 of file geometry.py.
| int zlayout.geometry.Point.__hash__ | ( | self | ) |
Definition at line 34 of file geometry.py.
| str zlayout.geometry.Point.__repr__ | ( | self | ) |
Definition at line 23 of file geometry.py.
| double zlayout::geometry::Point::angle_to | ( | const Point & | other | ) | const |
| double zlayout::geometry::Point::cross | ( | const Point & | other | ) | const |
| double zlayout::geometry::Point::distance_squared_to | ( | const Point & | other | ) | const |
| float zlayout.geometry.Point.distance_to | ( | self, | |
| 'Point' | other ) |
Calculate Euclidean distance to another point.
Definition at line 37 of file geometry.py.
| double zlayout::geometry::Point::distance_to | ( | const Point & | other | ) | const |
Calculate distance from this point to a line segment.
Definition at line 41 of file geometry.py.
| double zlayout::geometry::Point::distance_to_line | ( | const Point & | line_start, |
| const Point & | line_end ) const |
Calculate distance from this point to a line segment.
| line_start | Start point of line segment |
| line_end | End point of line segment |
Definition at line 68 of file point.cpp.
| double zlayout::geometry::Point::dot | ( | const Point & | other | ) | const |
| bool zlayout::geometry::Point::is_zero | ( | ) | const |
| double zlayout::geometry::Point::magnitude | ( | ) | const |
| double zlayout::geometry::Point::magnitude_squared | ( | ) | const |
| Point zlayout::geometry::Point::normalize | ( | ) | const |
| bool zlayout::geometry::Point::operator!= | ( | const Point & | other | ) | const |
| Point zlayout::geometry::Point::operator* | ( | double | scalar | ) | const |
| Point zlayout::geometry::Point::operator/ | ( | double | scalar | ) | const |
Assignment operator.
| bool zlayout::geometry::Point::operator== | ( | const Point & | other | ) | const |
| Point zlayout::geometry::Point::rotate | ( | double | angle | ) | const |
| zlayout.geometry.Point.to_numpy | ( | self | ) |
Convert to numpy array (if numpy is available).
Definition at line 61 of file geometry.py.
| std::string zlayout::geometry::Point::to_string | ( | ) | const |
|
friend |
|
staticconstexpr |
| zlayout.geometry.Point.x = float(x) |
Definition at line 20 of file geometry.py.
| zlayout.geometry.Point.y = float(y) |
Definition at line 21 of file geometry.py.