\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.14.2 - 2D and 3D Linear Geometry Kernel

compare2.png
See also
CGAL::compare_xy()
CGAL::compare_xyz()
CGAL::compare_x()
CGAL::compare_y()
CGAL::compare_yx()
CGAL::compare_x_at_y()
CGAL::compare_z()

Functions

template<typename Kernel >
Comparison_result CGAL::compare_y_at_x (const CGAL::Point_2< Kernel > &p, const CGAL::Line_2< Kernel > &h)
 compares the \( y\)-coordinates of p and the vertical projection of p on h. More...
 
template<typename Kernel >
Comparison_result CGAL::compare_y_at_x (const CGAL::Point_2< Kernel > &p, const CGAL::Line_2< Kernel > &h1, const CGAL::Line_2< Kernel > &h2)
 compares the \( y\)-coordinates of the vertical projection of p on h1 and on h2. More...
 
template<typename Kernel >
Comparison_result CGAL::compare_y_at_x (const CGAL::Line_2< Kernel > &l1, const CGAL::Line_2< Kernel > &l2, const CGAL::Line_2< Kernel > &h)
 Let p be the intersection of lines l1 and l2. More...
 
template<typename Kernel >
Comparison_result CGAL::compare_y_at_x (const CGAL::Line_2< Kernel > &l1, const CGAL::Line_2< Kernel > &l2, const CGAL::Line_2< Kernel > &h1, const CGAL::Line_2< Kernel > &h2)
 Let p be the intersection of lines l1 and l2. More...
 
template<typename Kernel >
Comparison_result CGAL::compare_y_at_x (const CGAL::Point_2< Kernel > &p, const CGAL::Segment_2< Kernel > &s)
 compares the \( y\)-coordinates of p and the vertical projection of p on s. More...
 
template<typename Kernel >
Comparison_result CGAL::compare_y_at_x (const CGAL::Point_2< Kernel > &p, const CGAL::Segment_2< Kernel > &s1, const CGAL::Segment_2< Kernel > &s2)
 compares the \( y\)-coordinates of the vertical projection of p on s1 and on s2. More...
 

With the 2D Circular Kernel

See 2D Circular Geometry Kernel.

#include <CGAL/global_functions_circular_kernel_2.h>
template<typename CircularKernel >
Comparison_result CGAL::compare_y_at_x (const CGAL::Circular_arc_point_2< CircularKernel > &p, const CGAL::Circular_arc_2< CircularKernel > &a)
 Same as above, for a point and a circular arc.
 
template<typename CircularKernel >
Comparison_result CGAL::compare_y_at_x (const CGAL::Circular_arc_point_2< CircularKernel > &p, const CGAL::Line_arc_2< CircularKernel > &a)
 Same as above, for a point and a line segment.
 

Function Documentation

◆ compare_y_at_x() [1/6]

template<typename Kernel >
Comparison_result CGAL::compare_y_at_x ( const CGAL::Point_2< Kernel > &  p,
const CGAL::Line_2< Kernel > &  h 
)

#include <CGAL/Kernel/global_functions.h>

compares the \( y\)-coordinates of p and the vertical projection of p on h.

See Figure figcompareyatx (d).

Precondition
h is not vertical.

◆ compare_y_at_x() [2/6]

template<typename Kernel >
Comparison_result CGAL::compare_y_at_x ( const CGAL::Point_2< Kernel > &  p,
const CGAL::Line_2< Kernel > &  h1,
const CGAL::Line_2< Kernel > &  h2 
)

#include <CGAL/Kernel/global_functions.h>

compares the \( y\)-coordinates of the vertical projection of p on h1 and on h2.

See Figure figcompareyatx (e).

Precondition
h1 and h2 are not vertical.

◆ compare_y_at_x() [3/6]

template<typename Kernel >
Comparison_result CGAL::compare_y_at_x ( const CGAL::Line_2< Kernel > &  l1,
const CGAL::Line_2< Kernel > &  l2,
const CGAL::Line_2< Kernel > &  h 
)

#include <CGAL/Kernel/global_functions.h>

Let p be the intersection of lines l1 and l2.

This function compares the \( y\)-coordinates of p and the vertical projection of p on h See Figure figcompareyatx (f).

Precondition
l1, l2 intersect and h is not vertical.

◆ compare_y_at_x() [4/6]

template<typename Kernel >
Comparison_result CGAL::compare_y_at_x ( const CGAL::Line_2< Kernel > &  l1,
const CGAL::Line_2< Kernel > &  l2,
const CGAL::Line_2< Kernel > &  h1,
const CGAL::Line_2< Kernel > &  h2 
)

#include <CGAL/Kernel/global_functions.h>

Let p be the intersection of lines l1 and l2.

This function compares the \( y\)-coordinates of the vertical projection of p on h1 and on h2. See Figure figcompareyatx (g).

Precondition
l1 and l2 intersect; h1 and h2 are not vertical.

◆ compare_y_at_x() [5/6]

template<typename Kernel >
Comparison_result CGAL::compare_y_at_x ( const CGAL::Point_2< Kernel > &  p,
const CGAL::Segment_2< Kernel > &  s 
)

#include <CGAL/Kernel/global_functions.h>

compares the \( y\)-coordinates of p and the vertical projection of p on s.

If s is vertical, then return CGAL::EQUAL when p lies on s, CGAL::SMALLER when p lies under {s}, and CGAL::LARGER otherwise.

Precondition
p is within the x range of s.

◆ compare_y_at_x() [6/6]

template<typename Kernel >
Comparison_result CGAL::compare_y_at_x ( const CGAL::Point_2< Kernel > &  p,
const CGAL::Segment_2< Kernel > &  s1,
const CGAL::Segment_2< Kernel > &  s2 
)

#include <CGAL/Kernel/global_functions.h>

compares the \( y\)-coordinates of the vertical projection of p on s1 and on s2.

If s1 or s2 is vertical, then return CGAL::EQUAL if they intersect, otherwise return CGAL::SMALLER if s1 lies below s2, and return CGAL::LARGER otherwise.

Precondition
p is within the x range of s1 and s2.