Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
point.H File Reference

2D point and geometric utilities. More...

#include <cmath>
#include <cstddef>
#include <limits>
#include <array>
#include <functional>
#include <iomanip>
#include <string>
#include <ahAssert.H>
#include <ahUtils.H>
#include <ah-errors.H>
#include <utility>
#include <gmpfrxx.h>
Include dependency graph for point.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Aleph::Geom_Object
 Base class for all geometric objects. More...
 
class  Aleph::Point
 Represents a point with rectangular coordinates in a 2D plane. More...
 
class  Aleph::Polar_Point
 Polar representation of a 2D point. More...
 
class  Aleph::Segment
 Represents a line segment between two points. More...
 
class  Aleph::Triangle
 A non-degenerate triangle defined by three points. More...
 
class  Aleph::Rectangle
 An axis-aligned rectangle. More...
 
class  Aleph::Ellipse
 An axis-aligned ellipse. More...
 
class  Aleph::RotatedEllipse
 An ellipse with arbitrary rotation. More...
 
struct  Aleph::RotatedEllipse::ExtremalPoints
 Holds the four axis-extremal points of a rotated ellipse. More...
 
class  Aleph::Text
 Represents a text string positioned at a 2D point. More...
 
class  Aleph::Point3D
 Represents a point in 3D space with exact rational coordinates. More...
 
class  Aleph::Segment3D
 Represents a line segment in 3D space. More...
 
class  Aleph::Triangle3D
 Represents a triangle in 3D space defined by three points. More...
 
struct  Aleph::Triangle3D::BaryCoords
 Structure to hold barycentric coordinates. More...
 
class  Aleph::Tetrahedron
 Represents a tetrahedron in 3D space defined by four points. More...
 
struct  Aleph::Tetrahedron::Faces
 A struct holding the four faces of the tetrahedron. More...
 
struct  std::hash< Aleph::Point >
 Hash specialization for Aleph::Point. More...
 

Namespaces

namespace  Aleph
 Main namespace for Aleph-w library functions.
 
namespace  std
 STL namespace.
 

Typedefs

using Aleph::Geom_Number = mpq_class
 Numeric type used by the geometry module.
 

Enumerations

enum class  Aleph::Orientation { Aleph::CCW , Aleph::CW , Aleph::COLLINEAR }
 Classification of three-point orientation. More...
 
enum class  Aleph::InCircleResult { Aleph::INSIDE , Aleph::ON_CIRCLE , Aleph::OUTSIDE , Aleph::DEGENERATE }
 Classification of a point with respect to a triangle circumcircle. More...
 

Functions

double Aleph::geom_number_to_double (const Geom_Number &n)
 Converts a Geom_Number to its double precision representation.
 
const Geom_NumberAleph::geom_pi ()
 High-precision pi value for computations that require Geom_Number.
 
Geom_Number Aleph::area_of_parallelogram (const Point &a, const Point &b, const Point &c)
 Compute the signed area of the parallelogram defined by vectors a->b and a->c.
 
Geom_Number Aleph::euclidean_distance (const Geom_Number &x, const Geom_Number &y)
 Euclidean distance (hypotenuse) of the vector (x, y).
 
Geom_Number Aleph::pitag (const Geom_Number &x, const Geom_Number &y)
 
Geom_Number Aleph::arctan (const Geom_Number &m)
 Arc tangent of m (wrapper over mpfr).
 
Geom_Number Aleph::arctan2 (const Geom_Number &m, const Geom_Number &n)
 Two-argument arc tangent (wrapper over mpfr).
 
Geom_Number Aleph::sinus (const Geom_Number &x)
 Sine of x (wrapper over mpfr).
 
Geom_Number Aleph::cosinus (const Geom_Number &x)
 Cosine of x (wrapper over mpfr).
 
Geom_Number Aleph::square_root (const Geom_Number &x)
 Square root of x (wrapper over mpfr).
 
Point Aleph::operator* (const Geom_Number &s, const Point &p)
 Scalar multiplication with commutative order.
 
size_t Aleph::approximate_string_size (const std::string &str)
 Estimate the count of printable characters in a LaTeX string.
 
Orientation Aleph::orientation (const Point &a, const Point &b, const Point &c)
 Return the orientation of the triple (a, b, c).
 
Geom_Number Aleph::in_circle_determinant (const Point &a, const Point &b, const Point &c, const Point &p)
 Return the exact in-circle determinant for (a,b,c,p).
 
InCircleResult Aleph::in_circle (const Point &a, const Point &b, const Point &c, const Point &p)
 Classify point p against circumcircle of triangle (a,b,c), exactly.
 
bool Aleph::on_segment (const Segment &s, const Point &p)
 Return true if p lies on segment s (exact).
 
bool Aleph::segments_intersect (const Segment &s1, const Segment &s2)
 Return true if segments s1 and s2 intersect (including endpoints).
 
bool Aleph::segments_intersect (const Point &a, const Point &b, const Point &c, const Point &d)
 Return true if segments (a,b) and (c,d) intersect (including endpoints).
 
Point Aleph::segment_intersection_point (const Segment &s1, const Segment &s2)
 Compute the exact intersection point of segments s1 and s2.
 
Geom_Number Aleph::area_of_triangle (const Point &a, const Point &b, const Point &c)
 Return the (unsigned) area of triangle (a, b, c) as an exact rational.
 
Geom_Number Aleph::scalar_triple_product (const Point3D &a, const Point3D &b, const Point3D &c)
 Scalar triple product: a · (b × c).
 
std::ostream & Aleph::operator<< (std::ostream &o, const Point &p)
 
std::ostream & Aleph::operator<< (std::ostream &o, const Segment &s)
 
std::ostream & Aleph::operator<< (std::ostream &o, const Triangle &t)
 
std::ostream & Aleph::operator<< (std::ostream &o, const Rectangle &r)
 
std::ostream & Aleph::operator<< (std::ostream &o, const Ellipse &e)
 
std::ostream & Aleph::operator<< (std::ostream &o, const RotatedEllipse &e)
 
std::ostream & Aleph::operator<< (std::ostream &o, const Point3D &p)
 
std::ostream & Aleph::operator<< (std::ostream &o, const Segment3D &s)
 
std::ostream & Aleph::operator<< (std::ostream &o, const Triangle3D &t)
 
std::ostream & Aleph::operator<< (std::ostream &o, const Tetrahedron &t)
 

Variables

constexpr double Aleph::PI = 3.1415926535897932384626433832795028841971693993751
 
constexpr double Aleph::PI_2 = PI / 2.0
 
constexpr double Aleph::PI_4 = PI / 4.0
 

Detailed Description

2D point and geometric utilities.

This file provides classes for 2D points and geometric operations including distance calculations, vector operations, and coordinate transformations. Used by graph visualization and geometric algorithms.

Author
Leandro Rabindranath León

Definition in file point.H.