Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Point Struct Reference

Rectangular point in the plane. More...

#include <point.H>

Inheritance diagram for Point:
[legend]
Collaboration diagram for Point:
[legend]

Public Member Functions

 Point ()
 
 Point (const Geom_Number &__x, const Geom_Number &__y)
 Builds a new point in coordinates (__x, __y)
 
 Point (const Polar_Point &pp)
 Builds a copy of p.
 
bool operator== (const Point &point) const
 
bool operator!= (const Point &point) const
 
Point operator+ (const Point &p) const
 
Pointoperator+= (const Point &p)
 
Point operator- (const Point &p) const
 
Pointoperator-= (const Point &p)
 
const Geom_Numberget_x () const
 Returns x value.
 
const Geom_Numberget_y () const
 Returns y value.
 
bool is_colinear_with (const Point &p1, const Point &p2) const
 Returns true if this is colinear with p1 and p2.
 
bool is_colinear_with (const Segment &s) const
 Returns true if this is colinear with segment s.
 
bool is_to_left_from (const Point &p1, const Point &p2) const
 Return true if this is to left from points p1 and p2.
 
bool is_to_right_from (const Point &p1, const Point &p2) const
 Return true if this is to right from points p1 and p2.
 
bool is_to_left_on_from (const Point &p1, const Point &p2) const
 Return true if this is to left from (or on) points p1 and p2.
 
bool is_to_right_on_from (const Point &p1, const Point &p2) const
 Return true if this is to right from (or on) points p1 and p2.
 
bool is_clockwise_with (const Point &p1, const Point &p2) const
 Returns true if the sequence this-p1-p2 is clockwise.
 
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
 
bool is_between (const Point &p1, const Point &p2) const
 Returns true if this is between p1 and p2.
 
const Pointnearest_point (const Point &p1, const Point &p2) const
 Return the nearest point (to this) between p1 and p2.
 
bool is_inside (const Segment &s) const
 Returns true if this is inside of segment s.
 
bool is_inside (const Ellipse &e) const
 Returns true if this is inside of the ellipse e.
 
bool intersects_with (const Ellipse &e) const
 Returns true if this intersects ellipse e.
 
std::string to_string () const
 Return a string representation of this.
 
 operator std::string () const
 String cast operator.
 
Geom_Number distance_squared_to (const Point &that) const
 Returns the square distance between this y that.
 
Geom_Number distance_with (const Point &p) const
 Returns the Euclidean distance between this and p.
 
const Pointhighest_point () const
 
const Pointlowest_point () const
 
const Pointleftmost_point () const
 
const Pointrightmost_point () const
 
bool operator== (const Point &other) const
 
double distance () const
 
bool operator< (const Point &other) const
 
- Public Member Functions inherited from Geom_Object
 Geom_Object ()=default
 
virtual ~Geom_Object ()=default
 

Public Attributes

int x
 
int y
 
double x
 
double y
 

Private Attributes

Geom_Number x
 
Geom_Number y
 

Friends

class Segment
 
class Triangle
 
class Polar_Point
 

Detailed Description

Rectangular point in the plane.

Fundamental class which defines a point in a cartesians coordinates plane.

Definition at line 155 of file point.H.

Constructor & Destructor Documentation

◆ Point() [1/3]

Point::Point ( )
inline

Definition at line 165 of file point.H.

◆ Point() [2/3]

Point::Point ( const Geom_Number __x,
const Geom_Number __y 
)
inline

Builds a new point in coordinates (__x, __y)

Definition at line 170 of file point.H.

◆ Point() [3/3]

Point::Point ( const Polar_Point pp)
inline

Builds a copy of p.

Builds a new point from polar coordinates.

Definition at line 405 of file point.H.

Member Function Documentation

◆ distance()

double Point::distance ( ) const
inline

Definition at line 870 of file fibonacci_heap_test.cc.

References x, and y.

Referenced by operator<().

◆ distance_squared_to()

Geom_Number Point::distance_squared_to ( const Point that) const
inline

Returns the square distance between this y that.

Definition at line 871 of file point.H.

References Aleph::maps(), x, and y.

◆ distance_with()

Geom_Number Point::distance_with ( const Point p) const
inline

Returns the Euclidean distance between this and p.

Definition at line 880 of file point.H.

References Aleph::maps(), and Aleph::HTList::size().

Referenced by Ellipse::compute_tangents(), nearest_point(), TEST(), and TEST().

◆ get_x()

◆ get_y()

◆ highest_point()

const Point & Point::highest_point ( ) const
inline

Definition at line 321 of file point.H.

Referenced by TEST_F(), TEST_F(), TEST_F(), and TEST_F().

◆ intersects_with()

bool Point::intersects_with ( const Ellipse e) const
inline

Returns true if this intersects ellipse e.

Definition at line 1460 of file point.H.

References Ellipse::intersects_with().

◆ is_between()

bool Point::is_between ( const Point p1,
const Point p2 
) const
inline

Returns true if this is between p1 and p2.

Definition at line 277 of file point.H.

References get_x(), get_y(), is_colinear_with(), and Aleph::maps().

Referenced by Segment::contains_to(), and Segment::contains_to().

◆ is_clockwise_with() [1/2]

bool Point::is_clockwise_with ( const Point p1,
const Point p2 
) const
inline

Returns true if the sequence this-p1-p2 is clockwise.

Definition at line 265 of file point.H.

References area_of_parallelogram().

Referenced by is_clockwise_with().

◆ is_clockwise_with() [2/2]

bool Point::is_clockwise_with ( const Segment s) const
inline

Definition at line 864 of file point.H.

References is_clockwise_with(), Segment::src, and Segment::tgt.

◆ is_colinear_with() [1/2]

bool Point::is_colinear_with ( const Point p1,
const Point p2 
) const
inline

Returns true if this is colinear with p1 and p2.

Definition at line 232 of file point.H.

References area_of_parallelogram().

Referenced by Segment::intersects_properly_with(), is_between(), Segment::is_colinear_with(), and is_colinear_with().

◆ is_colinear_with() [2/2]

bool Point::is_colinear_with ( const Segment s) const
inline

Returns true if this is colinear with segment s.

Definition at line 846 of file point.H.

References is_colinear_with(), Segment::src, and Segment::tgt.

◆ is_inside() [1/2]

bool Point::is_inside ( const Ellipse e) const
inline

Returns true if this is inside of the ellipse e.

Definition at line 1454 of file point.H.

References Ellipse::contains_to().

◆ is_inside() [2/2]

bool Point::is_inside ( const Segment s) const
inline

Returns true if this is inside of segment s.

Definition at line 840 of file point.H.

References Segment::contains_to().

◆ is_to_left_from() [1/2]

bool Point::is_to_left_from ( const Point p1,
const Point p2 
) const
inline

Return true if this is to left from points p1 and p2.

Definition at line 241 of file point.H.

References area_of_parallelogram().

Referenced by Triangle::contains_to(), Segment::intersects_properly_with(), is_to_left_from(), Segment::is_to_right_from(), and is_to_right_on_from().

◆ is_to_left_from() [2/2]

bool Point::is_to_left_from ( const Segment s) const
inline

Definition at line 852 of file point.H.

References is_to_left_from(), Segment::src, and Segment::tgt.

◆ is_to_left_on_from()

bool Point::is_to_left_on_from ( const Point p1,
const Point p2 
) const
inline

Return true if this is to left from (or on) points p1 and p2.

Definition at line 253 of file point.H.

References is_to_right_from(), and Aleph::maps().

◆ is_to_right_from() [1/2]

bool Point::is_to_right_from ( const Point p1,
const Point p2 
) const
inline

Return true if this is to right from points p1 and p2.

Definition at line 247 of file point.H.

References area_of_parallelogram().

Referenced by Segment::is_to_left_from(), is_to_left_on_from(), is_to_right_from(), and Segment::mid_perpendicular().

◆ is_to_right_from() [2/2]

bool Point::is_to_right_from ( const Segment s) const
inline

Definition at line 858 of file point.H.

References is_to_right_from(), Segment::src, and Segment::tgt.

◆ is_to_right_on_from()

bool Point::is_to_right_on_from ( const Point p1,
const Point p2 
) const
inline

Return true if this is to right from (or on) points p1 and p2.

Definition at line 259 of file point.H.

References is_to_left_from(), and Aleph::maps().

◆ leftmost_point()

const Point & Point::leftmost_point ( ) const
inline

Definition at line 325 of file point.H.

Referenced by TEST_F().

◆ lowest_point()

const Point & Point::lowest_point ( ) const
inline

Definition at line 323 of file point.H.

Referenced by TEST_F().

◆ nearest_point()

const Point & Point::nearest_point ( const Point p1,
const Point p2 
) const
inline

Return the nearest point (to this) between p1 and p2.

Definition at line 291 of file point.H.

References distance_with().

Referenced by Segment::nearest_point().

◆ operator std::string()

Point::operator std::string ( ) const
inline

String cast operator.

Definition at line 313 of file point.H.

References to_string().

◆ operator!=()

bool Point::operator!= ( const Point point) const
inline

Definition at line 190 of file point.H.

References Aleph::maps().

◆ operator+()

Point Point::operator+ ( const Point p) const
inline

Definition at line 195 of file point.H.

References x, and y.

◆ operator+=()

Point & Point::operator+= ( const Point p)
inline

Definition at line 200 of file point.H.

References x, and y.

◆ operator-()

Point Point::operator- ( const Point p) const
inline

Definition at line 208 of file point.H.

References x, and y.

◆ operator-=()

Point & Point::operator-= ( const Point p)
inline

Definition at line 213 of file point.H.

References x, and y.

◆ operator<()

bool Point::operator< ( const Point other) const
inline

Definition at line 872 of file fibonacci_heap_test.cc.

References distance(), and Aleph::maps().

◆ operator==() [1/2]

bool Point::operator== ( const Point other) const
inline

Definition at line 966 of file dynsethash.cc.

References Aleph::maps(), x, and y.

◆ operator==() [2/2]

bool Point::operator== ( const Point point) const
inline

Definition at line 185 of file point.H.

References Aleph::maps(), x, and y.

Referenced by TEST().

◆ rightmost_point()

const Point & Point::rightmost_point ( ) const
inline

Definition at line 327 of file point.H.

Referenced by TEST_F(), TEST_F(), TEST_F(), and TEST_F().

◆ to_string()

std::string Point::to_string ( ) const
inline

Return a string representation of this.

Definition at line 306 of file point.H.

References geom_number_to_double(), x, and y.

Referenced by operator std::string(), and Segment::to_string().

Friends And Related Symbol Documentation

◆ Polar_Point

Definition at line 159 of file point.H.

◆ Segment

Definition at line 157 of file point.H.

◆ Triangle

Definition at line 158 of file point.H.

Member Data Documentation

◆ x [1/3]

◆ x [2/3]

int Point::x

Definition at line 964 of file dynsethash.cc.

◆ x [3/3]

double Point::x

Definition at line 869 of file fibonacci_heap_test.cc.

◆ y [1/3]

◆ y [2/3]

int Point::y

Definition at line 964 of file dynsethash.cc.

◆ y [3/3]

double Point::y

Definition at line 869 of file fibonacci_heap_test.cc.


The documentation for this struct was generated from the following files: