|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Represents a point with rectangular coordinates in a 2D plane. More...
#include <point.H>
Public Member Functions | |
| Point () | |
| Default constructor. | |
| Point (const Geom_Number &x, const Geom_Number &y) | |
| Constructs a point from Cartesian coordinates. | |
| Point (const Polar_Point &pp) | |
| Constructs a point from polar coordinates. | |
| bool | operator== (const Point &point) const noexcept |
| Checks for exact equality between two points. | |
| bool | operator!= (const Point &point) const noexcept |
| Checks for inequality between two points. | |
| bool | operator< (const Point &point) const noexcept |
| Defines a strict lexicographical ordering for points. | |
| Point | operator+ (const Point &p) const |
| Vector addition. | |
| Point & | operator+= (const Point &p) |
| Vector addition and assignment. | |
| Point | operator- (const Point &p) const |
| Vector subtraction. | |
| Point & | operator-= (const Point &p) |
| Vector subtraction and assignment. | |
| Point | operator- () const |
| Unary negation (vector inversion). | |
| Point | operator* (const Geom_Number &s) const |
| Scalar multiplication. | |
| Point | operator/ (const Geom_Number &s) const |
| Scalar division. | |
| Geom_Number | dot (const Point &p) const |
| Dot product. | |
| Geom_Number | cross (const Point &p) const |
| 2D cross-product (z-component of the 3D cross-product). | |
| Geom_Number | norm_squared () const |
| Squared Euclidean norm. | |
| Geom_Number | norm () const |
| Euclidean norm (vector magnitude). | |
| Point | normalize () const |
| Returns a normalized copy of this vector (magnitude 1). | |
| Point | rotate (const Geom_Number &angle) const |
| Rotates the point around the origin by a given angle. | |
| Point | lerp (const Point &other, const Geom_Number &t) const |
| Linear interpolation between this point and another. | |
| Point | midpoint (const Point &other) const |
| Calculates the midpoint between this point and another. | |
| const Geom_Number & | get_x () const noexcept |
| Gets the x-coordinate value. | |
| const Geom_Number & | get_y () const noexcept |
| Gets the y-coordinate value. | |
| bool | is_colinear_with (const Point &p1, const Point &p2) const |
| Checks if this point is collinear with two other points. | |
| bool | is_colinear_with (const Segment &s) const |
| Checks if this point is collinear with a segment. | |
| bool | is_left_of (const Point &p1, const Point &p2) const |
| Checks if this point is to the left of the directed line from p1 to p2. | |
| bool | is_to_left_from (const Point &p1, const Point &p2) const |
| bool | is_to_right_from (const Point &p1, const Point &p2) const |
| Checks if this point is to the right of the directed line from p1 to p2. | |
| bool | is_to_left_on_from (const Point &p1, const Point &p2) const |
| Checks if this point is to the left of or on the line from p1 to p2. | |
| bool | is_right_on_of (const Point &p1, const Point &p2) const |
| Checks if this point is to the right of or on the line from p1 to p2. | |
| bool | is_to_right_on_from (const Point &p1, const Point &p2) const |
| bool | is_clockwise_with (const Point &p1, const Point &p2) const |
| Determines if the sequence of three points (this, p1, p2) makes a clockwise turn. | |
| bool | is_left_of (const Segment &s) const |
| Checks if this point is to the left of a directed segment. | |
| bool | is_right_of (const Segment &s) const |
| Checks if this point is to the right of a directed segment. | |
| bool | is_to_left_from (const Segment &s) const |
| bool | is_to_right_from (const Segment &s) const |
| bool | is_clockwise_with (const Segment &s) const |
| Determines if the sequence (this, s.src, s.tgt) makes a clockwise turn. | |
| bool | is_between (const Point &p1, const Point &p2) const |
| Checks if this point is on the bounding box of p1 and p2 and is collinear with them. | |
| const Point & | nearest_point (const Point &p1, const Point &p2) const |
| Returns which of the two points, p1 or p2, is nearer to this point. | |
| bool | is_inside (const Segment &s) const |
| Checks if this point is contained within a segment. | |
| bool | is_inside (const Ellipse &e) const |
| Checks if this point is contained within an ellipse. | |
| bool | intersects_with (const Ellipse &e) const |
| Checks if this point lies exactly on the boundary of an ellipse. | |
| std::string | to_string () const |
| Returns a string representation of the point as "(x,y)". | |
| operator std::string () const | |
Cast operator to std::string. | |
| Geom_Number | distance_squared_to (const Point &that) const |
| Calculates the squared Euclidean distance to another point. | |
| Geom_Number | distance_to (const Point &p) const |
| Calculates the Euclidean distance to another point. | |
| Geom_Number | distance_with (const Point &p) const |
| const Point & | highest_point () const |
| Returns the highest point (largest y-coordinate). | |
| const Point & | lowest_point () const |
| Returns the lowest point (smallest y-coordinate). | |
| const Point & | leftmost_point () const |
| Returns the leftmost point (smallest x-coordinate). | |
| const Point & | rightmost_point () const |
| Returns the rightmost point (largest x-coordinate). | |
Public Member Functions inherited from Aleph::Geom_Object | |
| Geom_Object ()=default | |
| virtual | ~Geom_Object ()=default |
Private Attributes | |
| Geom_Number | x_ |
| Geom_Number | y_ |
Friends | |
| class | Segment |
| class | Triangle |
| class | Polar_Point |
Represents a point with rectangular coordinates in a 2D plane.
Fundamental class defining a point in a Cartesian coordinate plane. It provides vector operations, transformations, and geometric predicates. Uses the Geom_Number type for exact-precision arithmetic.
|
inline |
|
inline |
|
inline |
Constructs a point from polar coordinates.
| pp | The point in polar coordinates (Polar_Point) to be converted. |
|
inline |
2D cross-product (z-component of the 3D cross-product).
| p | The other vector (point). |
x1*y2 - y1*x2. Its sign indicates orientation. Definition at line 383 of file point.H.
Referenced by Aleph::Segment::intersection_with().
|
inline |
Calculates the squared Euclidean distance to another point.
| that | The other point. |
Definition at line 1454 of file point.H.
Referenced by Aleph::MinimumEnclosingCircle::Circle::contains(), Aleph::ClosestPairDivideAndConquer::dist2(), dist2(), Aleph::MinimumEnclosingCircle::from_three_points(), Aleph::MinimumEnclosingCircle::from_two_points(), Aleph::RotatingCalipersConvexPolygon::make_diameter(), K2Tree< T >::nearest(), nearest_point(), Aleph::GiftWrappingConvexHull::operator()(), Aleph::AlphaShape::operator()(), and TEST_F().
|
inline |
Calculates the Euclidean distance to another point.
| p | The other point. |
Definition at line 1463 of file point.H.
References Aleph::euclidean_distance(), x_, and y_.
Referenced by Aleph::Segment::distance_to(), distance_with(), Aleph::Euclidian_Graph< __Euclidian_Node, __Euclidian_Arc >::get_distance(), Aleph::Triangle::incenter(), and Aleph::Triangle::perimeter().
|
inline |
Definition at line 679 of file point.H.
References distance_to().
|
inline |
Dot product.
| p | The other vector (point). |
x1*x2 + y1*y2). Definition at line 373 of file point.H.
Referenced by Aleph::Segment::get_perpendicular(), and Aleph::Segment::project().
|
inlinenoexcept |
Gets the x-coordinate value.
Definition at line 457 of file point.H.
References x_.
Referenced by Aleph::Abstract_Euclidian_Plane< __Euclidian_Graph >::Abstract_Euclidian_Plane(), Aleph::Polar_Point::Polar_Point(), Aleph::Abstract_Euclidian_Plane< __Euclidian_Graph >::add_point(), Aleph::Polygon::add_vertex(), Aleph::VisibilityPolygon::angle_less(), Aleph::area_of_parallelogram(), Aleph::Tikz_Plane::bbox_of(), Aleph::Tikz_Plane::bbox_of(), Aleph::Tikz_Plane::bbox_of(), Aleph::Tikz_Plane::bbox_of(), Aleph::Tikz_Plane::bbox_of(), Aleph::Tikz_Plane::bbox_of(), Aleph::VoronoiDiagramFromDelaunay::bisector_halfplane_for_site(), Aleph::AABBTree::box_contains_point(), K2Tree< T >::bu_insert(), K2Tree< T >::build(), Aleph::RangeTree2D::build(), K2Tree< T >::build_balanced(), Aleph::MonotonePolygonTriangulation::build_faces_from_diagonals(), build_poly_graph(), Aleph::SweepLineSegmentIntersection::canonicalize(), Aleph::Polygon::centroid(), Aleph::Triangle::circumcenter(), Aleph::VoronoiDiagramFromDelaunay::circumcenter(), Aleph::ConvexPolygonDistanceGJK::closest_from_simplex(), Aleph::BruteForceConvexHull::CmpSegment::cmp_point(), Aleph::SegmentSegmentIntersection::collinear_overlap(), Eepic_Plane::compute_extreme_points(), Eepic_Plane::compute_geom_plane(), Aleph::Ellipse::compute_radius(), Aleph::Segment::compute_slope(), Aleph::Segment::compute_tgt_point(), Aleph::TrapezoidalMapPointLocation::Result::contains(), Aleph::BezierCurve::control_bbox(), Aleph::Segment::counterclockwise_angle_with(), Aleph::MinkowskiSumConvex::cross(), Aleph::ShortestPathInPolygon::cross(), Aleph::BezierCurve::cubic(), Aleph::KDTreePointSearch::debug_snapshot(), demo_convex_hull_cities(), demo_coverage_area(), Eepic_Triangle::draw(), Eepic_Plane::draw_cartesian_axis(), Eepic_Plane::draw_ellipse(), Eepic_Plane::draw_point(), Eepic_Plane::draw_point_text(), Aleph::Tikz_Plane::draw_rotated_ellipse(), Eepic_Plane::draw_text(), Eepic_Plane::draw_vertex_numbers_in_polygon(), Aleph::HalfPlaneIntersection::HalfPlane::dx(), Aleph::MonotonePolygonTriangulation::edge_x_at_y(), Aleph::VoronoiDiagramFortune::enqueue_circle_event(), Aleph::SweepLineSegmentIntersection::event_less(), export_csv(), Aleph::Point3D::from_2d(), Aleph::Point3D::from_2d(), Aleph::MinimumEnclosingCircle::from_three_points(), Aleph::GiftWrappingConvexHull::get_lowest_point(), Aleph::Polar_Point::get_quadrant(), Aleph::Abstract_Euclidian_Plane< __Euclidian_Graph >::get_width(), Aleph::Ellipse::highest_point(), hull_signature(), Aleph::in_circle_determinant(), Aleph::Ellipse::intersection_with(), Aleph::Ellipse::intersects_with(), Aleph::MonotonePolygonTriangulation::is_above(), is_between(), Aleph::MonotonePolygonTriangulation::EdgeStatusTree::left_edge_of_point(), Aleph::Triangle::leftmost_point(), Aleph::Ellipse::leftmost_point(), Aleph::Segment::leftmost_point(), Aleph::Segment::length(), Aleph::ConvexPolygonDistanceGJK::lerp_point(), Aleph::RegularTriangulationBowyerWatson::lex_less(), Aleph::KDTreePointSearch::lexicographic_less(), Aleph::DelaunayTriangulationBowyerWatson::lexicographic_less(), Aleph::ConstrainedDelaunayTriangulation::lexicographic_less(), Aleph::ConvexPolygonOffset::line_intersect(), Aleph::HalfPlaneIntersection::line_intersection(), Aleph::ConvexPolygonIntersectionBasic::line_intersection(), Aleph::Ellipse::lowest_point(), K2Tree< T >::lr_insert(), main(), main(), Aleph::Tikz_Plane::map_point(), Aleph::Segment::mid_perpendicular(), Aleph::Segment::mid_point(), objective(), Aleph::HalfPlaneIntersection::HalfPlane::offset(), Aleph::ConvexPolygonOffset::offset_edge(), std::hash< Aleph::Point >::operator()(), Aleph::SweepLineSegmentIntersection::operator()(), Aleph::SegmentArrangement::operator()(), Aleph::DelaunayTriangulationRandomizedIncremental::operator()(), Aleph::ClosestPairDivideAndConquer::LexicographicCmp::operator()(), Aleph::ClosestPairDivideAndConquer::ByYCmp::operator()(), Aleph::AndrewMonotonicChainConvexHull::LexicographicCmp::operator()(), Aleph::GrahamScanConvexHull::LexicographicCmp::operator()(), Aleph::VisibilityPolygon::operator()(), Aleph::operator<<(), Aleph::LineEq::perpendicular_through(), Aleph::RegularTriangulationBowyerWatson::point_in_power_circle(), Aleph::SegmentSegmentIntersection::point_less_on_axis(), Eepic_Plane::point_string(), points_equal(), polygon_area(), Aleph::PowerDiagram::power_center(), print_point(), print_point(), print_point(), print_polygon(), print_polygon(), print_triangle(), Aleph::SegmentArrangement::pt_less(), Aleph::put_trapezoidal_map_result(), Aleph::BezierCurve::quadratic(), Aleph::VisibilityPolygon::ray_edge_hit(), Aleph::ray_endpoint(), Aleph::VisibilityPolygon::ray_param(), Aleph::ClosestPairDivideAndConquer::recurse(), Aleph::Polygon::remove_vertex(), Aleph::Triangle::rightmost_point(), Aleph::Ellipse::rightmost_point(), Aleph::Segment::rightmost_point(), Aleph::Ellipse::sample(), scenario_exact_intersection(), Aleph::QuickHull::search_extremes(), Aleph::Segment::sense(), Aleph::Polygon::signed_area(), Aleph::GeomPolygonUtils::signed_double_area(), Aleph::Segment::slope_exact(), Aleph::SweepLineSegmentIntersection::slope_less(), sorted_hull_vertices(), Aleph::BezierCurve::split_cubic(), Aleph::detail::spp_cross(), Aleph::PolygonOffset::sq_dist(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), Aleph::GeomSerializer::to_geojson(), Aleph::GeomSerializer::to_geojson(), Aleph::GeomSerializer::to_geojson(), Aleph::RotatedEllipse::to_local(), Aleph::GeomSerializer::to_wkt(), Aleph::GeomSerializer::to_wkt(), Aleph::GeomSerializer::to_wkt(), Aleph::RotatedEllipse::to_world(), triangle_area(), Aleph::Polygon::update_extreme_points(), write_polygon_wkt(), write_polygon_wkt(), write_polygon_wkt(), K2Tree< T >::Node::x(), and Aleph::SweepLineSegmentIntersection::y_at_x().
|
inlinenoexcept |
Gets the y-coordinate value.
Definition at line 466 of file point.H.
References y_.
Referenced by Aleph::Abstract_Euclidian_Plane< __Euclidian_Graph >::Abstract_Euclidian_Plane(), Aleph::Polar_Point::Polar_Point(), Aleph::Abstract_Euclidian_Plane< __Euclidian_Graph >::add_point(), Aleph::Polygon::add_vertex(), Aleph::VisibilityPolygon::angle_less(), Aleph::area_of_parallelogram(), Aleph::Tikz_Plane::bbox_of(), Aleph::Tikz_Plane::bbox_of(), Aleph::Tikz_Plane::bbox_of(), Aleph::Tikz_Plane::bbox_of(), Aleph::Tikz_Plane::bbox_of(), Aleph::Tikz_Plane::bbox_of(), Aleph::VoronoiDiagramFromDelaunay::bisector_halfplane_for_site(), Aleph::AABBTree::box_contains_point(), K2Tree< T >::bu_insert(), K2Tree< T >::build(), Aleph::RangeTree2D::build(), K2Tree< T >::build_balanced(), Aleph::MonotonePolygonTriangulation::build_faces_from_diagonals(), build_poly_graph(), Aleph::SweepLineSegmentIntersection::canonicalize(), Aleph::Polygon::centroid(), Aleph::Triangle::circumcenter(), Aleph::VoronoiDiagramFromDelaunay::circumcenter(), Aleph::ConvexPolygonDistanceGJK::closest_from_simplex(), Aleph::BruteForceConvexHull::CmpSegment::cmp_point(), Eepic_Plane::compute_extreme_points(), Eepic_Plane::compute_geom_plane(), Aleph::Ellipse::compute_radius(), Aleph::Segment::compute_slope(), Aleph::Segment::compute_tgt_point(), Aleph::TrapezoidalMapPointLocation::Result::contains(), Aleph::BezierCurve::control_bbox(), Aleph::Segment::counterclockwise_angle_with(), Aleph::MinkowskiSumConvex::cross(), Aleph::ShortestPathInPolygon::cross(), Aleph::BezierCurve::cubic(), Aleph::KDTreePointSearch::debug_snapshot(), demo_convex_hull_cities(), demo_coverage_area(), Eepic_Triangle::draw(), Eepic_Plane::draw_cartesian_axis(), Eepic_Plane::draw_ellipse(), Eepic_Plane::draw_point(), Eepic_Plane::draw_point_text(), Aleph::Tikz_Plane::draw_rotated_ellipse(), Eepic_Plane::draw_text(), Eepic_Plane::draw_vertex_numbers_in_polygon(), Aleph::HalfPlaneIntersection::HalfPlane::dy(), Aleph::MonotonePolygonTriangulation::edge_x_at_y(), Aleph::VoronoiDiagramFortune::enqueue_circle_event(), Aleph::SweepLineSegmentIntersection::event_less(), export_csv(), Aleph::Point3D::from_2d(), Aleph::Point3D::from_2d(), Aleph::MinimumEnclosingCircle::from_three_points(), Aleph::Abstract_Euclidian_Plane< __Euclidian_Graph >::get_height(), Aleph::GiftWrappingConvexHull::get_lowest_point(), Aleph::Polar_Point::get_quadrant(), Aleph::Triangle::highest_point(), Aleph::Ellipse::highest_point(), Aleph::Segment::highest_point(), hull_signature(), Aleph::in_circle_determinant(), Aleph::Ellipse::intersection_with(), Aleph::Ellipse::intersects_with(), Aleph::MonotonePolygonTriangulation::is_above(), is_between(), Aleph::Ellipse::leftmost_point(), Aleph::Segment::length(), Aleph::ConvexPolygonDistanceGJK::lerp_point(), Aleph::RegularTriangulationBowyerWatson::lex_less(), Aleph::KDTreePointSearch::lexicographic_less(), Aleph::DelaunayTriangulationBowyerWatson::lexicographic_less(), Aleph::ConstrainedDelaunayTriangulation::lexicographic_less(), Aleph::ConvexPolygonOffset::line_intersect(), Aleph::HalfPlaneIntersection::line_intersection(), Aleph::ConvexPolygonIntersectionBasic::line_intersection(), Aleph::Polygon::locate_point(), Aleph::Triangle::lowest_point(), Aleph::Ellipse::lowest_point(), Aleph::Segment::lowest_point(), K2Tree< T >::lr_insert(), main(), main(), Aleph::Tikz_Plane::map_point(), Aleph::Segment::mid_perpendicular(), Aleph::Segment::mid_point(), objective(), Aleph::HalfPlaneIntersection::HalfPlane::offset(), Aleph::ConvexPolygonOffset::offset_edge(), std::hash< Aleph::Point >::operator()(), Aleph::SweepLineSegmentIntersection::operator()(), Aleph::DelaunayTriangulationRandomizedIncremental::operator()(), Aleph::ClosestPairDivideAndConquer::LexicographicCmp::operator()(), Aleph::ClosestPairDivideAndConquer::ByYCmp::operator()(), Aleph::AndrewMonotonicChainConvexHull::LexicographicCmp::operator()(), Aleph::GrahamScanConvexHull::LexicographicCmp::operator()(), Aleph::VisibilityPolygon::operator()(), Aleph::operator<<(), Aleph::LineEq::perpendicular_through(), Aleph::RegularTriangulationBowyerWatson::point_in_power_circle(), Aleph::BooleanPolygonOperations::point_inside_ccw(), Aleph::SegmentSegmentIntersection::point_less_on_axis(), Eepic_Plane::point_string(), points_equal(), polygon_area(), Aleph::PowerDiagram::power_center(), print_point(), print_point(), print_point(), print_polygon(), print_polygon(), print_triangle(), Aleph::SegmentArrangement::pt_less(), Aleph::put_trapezoidal_map_result(), Aleph::BezierCurve::quadratic(), Aleph::VisibilityPolygon::ray_edge_hit(), Aleph::ray_endpoint(), Aleph::VisibilityPolygon::ray_param(), Aleph::Polygon::remove_vertex(), Aleph::Ellipse::rightmost_point(), Aleph::Ellipse::sample(), scenario_exact_intersection(), Aleph::Segment::sense(), Aleph::Polygon::signed_area(), Aleph::GeomPolygonUtils::signed_double_area(), Aleph::Segment::slope_exact(), Aleph::SweepLineSegmentIntersection::slope_less(), sorted_hull_vertices(), Aleph::BezierCurve::split_cubic(), Aleph::detail::spp_cross(), Aleph::PolygonOffset::sq_dist(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), Aleph::GeomSerializer::to_geojson(), Aleph::GeomSerializer::to_geojson(), Aleph::GeomSerializer::to_geojson(), Aleph::RotatedEllipse::to_local(), Aleph::GeomSerializer::to_wkt(), Aleph::GeomSerializer::to_wkt(), Aleph::GeomSerializer::to_wkt(), Aleph::RotatedEllipse::to_world(), triangle_area(), Aleph::Polygon::update_extreme_points(), write_polygon_wkt(), write_polygon_wkt(), write_polygon_wkt(), K2Tree< T >::Node::y(), and Aleph::SweepLineSegmentIntersection::y_at_x().
Checks if this point lies exactly on the boundary of an ellipse.
| e | The ellipse to check against. |
true if the point is on the boundary. Definition at line 2366 of file point.H.
References Aleph::Ellipse::intersects_with().
Checks if this point is on the bounding box of p1 and p2 and is collinear with them.
| p1 | First point of the segment. |
| p2 | Second point of the segment. |
true if this point lies on the segment joining p1 and p2. Definition at line 599 of file point.H.
References Aleph::and, Aleph::divide_and_conquer_partition_dp(), get_x(), get_y(), and is_colinear_with().
Referenced by Aleph::Segment::contains().
Determines if the sequence of three points (this, p1, p2) makes a clockwise turn.
| p1 | The second point in the sequence. |
| p2 | The third point in the sequence. |
true if the orientation is clockwise. Definition at line 553 of file point.H.
References Aleph::area_of_parallelogram().
Referenced by is_clockwise_with().
Determines if the sequence (this, s.src, s.tgt) makes a clockwise turn.
| s | The segment. |
true if the orientation is clockwise. Definition at line 1447 of file point.H.
References is_clockwise_with(), Aleph::Segment::src_, and Aleph::Segment::tgt_.
Checks if this point is collinear with two other points.
| p1 | The first point. |
| p2 | The second point. |
true if all three points lie on the same line. Definition at line 477 of file point.H.
References Aleph::area_of_parallelogram().
Referenced by Aleph::Polygon::add_vertex(), is_between(), Aleph::Segment::is_colinear_with(), is_colinear_with(), and TEST_F().
Checks if this point is collinear with a segment.
| s | The segment. |
true if the point lies on the infinite line defined by the segment. Definition at line 1429 of file point.H.
References is_colinear_with(), Aleph::Segment::src_, and Aleph::Segment::tgt_.
Checks if this point is contained within an ellipse.
| e | The ellipse to check against. |
true if the point is inside or on the boundary of the ellipse. Definition at line 2360 of file point.H.
References Aleph::Ellipse::contains().
Checks if this point is contained within a segment.
| s | The segment to check against. |
true if the point is on the segment. Definition at line 1423 of file point.H.
References Aleph::Segment::contains().
Referenced by Aleph::Polygon::add_vertex().
Checks if this point is to the left of the directed line from p1 to p2.
| p1 | The starting point of the line. |
| p2 | The ending point of the line. |
true if the point is to the left. Definition at line 495 of file point.H.
References Aleph::area_of_parallelogram().
Referenced by Aleph::Triangle::contains(), Aleph::CuttingEarsTriangulation::in_cone(), is_left_of(), Aleph::Segment::is_right_of(), is_right_on_of(), is_to_left_from(), and is_to_left_from().
Checks if this point is to the left of a directed segment.
| s | The segment. |
true if the point is to the left. Definition at line 1435 of file point.H.
References is_left_of(), Aleph::Segment::src_, and Aleph::Segment::tgt_.
Checks if this point is to the right of a directed segment.
| s | The segment. |
true if the point is to the right. Definition at line 1441 of file point.H.
References Aleph::area_of_parallelogram(), Aleph::Segment::src_, and Aleph::Segment::tgt_.
Referenced by Aleph::Segment::is_left_of(), and is_to_right_from().
Checks if this point is to the right of or on the line from p1 to p2.
| p1 | The starting point of the line. |
| p2 | The ending point of the line. |
true if the point is not to the left. Definition at line 535 of file point.H.
References Aleph::divide_and_conquer_partition_dp(), and is_left_of().
Referenced by is_to_right_on_from().
Definition at line 502 of file point.H.
References is_left_of().
Definition at line 574 of file point.H.
References is_left_of().
Checks if this point is to the left of or on the line from p1 to p2.
| p1 | The starting point of the line. |
| p2 | The ending point of the line. |
true if the point is not to the right. Definition at line 524 of file point.H.
References Aleph::divide_and_conquer_partition_dp(), and is_to_right_from().
Referenced by Aleph::CuttingEarsTriangulation::in_cone().
Checks if this point is to the right of the directed line from p1 to p2.
| p1 | The starting point of the line. |
| p2 | The ending point of the line. |
true if the point is to the right. Definition at line 513 of file point.H.
References Aleph::area_of_parallelogram().
Referenced by Aleph::Triangle::contains(), and is_to_left_on_from().
Definition at line 581 of file point.H.
References is_right_of().
Definition at line 542 of file point.H.
References is_right_on_of().
|
inline |
Linear interpolation between this point and another.
| other | The other point for interpolation. |
| t | The interpolation parameter, typically in [0, 1]. |
this * (1-t) + other * t. Definition at line 437 of file point.H.
References Aleph::divide_and_conquer_partition_dp().
Referenced by Aleph::Segment::at(), Aleph::Segment::get_perpendicular(), and midpoint().
Calculates the midpoint between this point and another.
| other | The other point. |
lerp(other, 0.5). Definition at line 448 of file point.H.
References Aleph::divide_and_conquer_partition_dp(), and lerp().
Referenced by Aleph::MinimumEnclosingCircle::from_two_points().
Returns which of the two points, p1 or p2, is nearer to this point.
| p1 | The first candidate point. |
| p2 | The second candidate point. |
p1 or p2). Definition at line 618 of file point.H.
References distance_squared_to().
Referenced by arc_segment(), arc_trigon(), Aleph::Segment::nearest_point(), and TEST_F().
|
inline |
Euclidean norm (vector magnitude).
Definition at line 402 of file point.H.
References Aleph::euclidean_distance(), x_, and y_.
Referenced by normalize().
|
inline |
|
inline |
|
inline |
Cast operator to std::string.
to_string(). Definition at line 661 of file point.H.
References to_string().
Checks for inequality between two points.
| point | The other point to compare against. |
true if either the x or y coordinate is different. Definition at line 278 of file point.H.
References Aleph::divide_and_conquer_partition_dp().
|
inline |
|
inline |
|
inline |
Defines a strict lexicographical ordering for points.
| point | The other point to compare against. |
true if this point is less than point (first by x, then by y). Definition at line 288 of file point.H.
References Aleph::and, Aleph::divide_and_conquer_partition_dp(), x_, and y_.
|
inline |
Rotates the point around the origin by a given angle.
| angle | The rotation angle in radians. |
Point with the rotated coordinates. Definition at line 424 of file point.H.
References Aleph::cosinus(), Aleph::divide_and_conquer_partition_dp(), Aleph::sinus(), x_, and y_.
|
inline |
Returns a string representation of the point as "(x,y)".
std::string representing the point. Definition at line 651 of file point.H.
References Aleph::geom_number_to_double(), x_, and y_.
Referenced by Eepic_Triangle::draw(), Eepic_Plane::draw(), Eepic_Plane::draw_ellipse(), Eepic_Plane::draw_point(), Eepic_Plane::draw_point_text(), Eepic_Plane::draw_text(), main(), make_random_polygon(), operator std::string(), Aleph::operator<<(), print_case(), scenario_exact_intersection(), Aleph::Segment::to_string(), Aleph::Ellipse::to_string(), Aleph::RotatedEllipse::to_string(), and write_tree().
|
friend |
|
private |
Definition at line 234 of file point.H.
Referenced by cross(), distance_squared_to(), distance_to(), dot(), get_x(), norm(), norm_squared(), operator*(), operator+(), operator+=(), operator-(), operator-(), operator-=(), operator/(), operator<(), operator==(), rotate(), and to_string().
|
private |
Definition at line 235 of file point.H.
Referenced by cross(), distance_squared_to(), distance_to(), dot(), get_y(), norm(), norm_squared(), operator*(), operator+(), operator+=(), operator-(), operator-(), operator-=(), operator/(), operator<(), operator==(), rotate(), and to_string().