Fade2D Documentation pages v2.12
Delaunay Features
Point2.h File Reference
#include "common.h"
#include "Vector2.h"

Go to the source code of this file.

Classes

class  GEOM_FADE2D::Point2
 Point. More...
 
struct  GEOM_FADE2D::VtxColor
 

Functions

Point2 GEOM_FADE2D::center (const Point2 &p0, const Point2 &p1)
 Compute the midpoint of p0 and p1. More...
 
Point2 GEOM_FADE2D::centerWithShift (const Point2 &p0, const Point2 &p1)
 Compute the midpoint of p0 and p1 and adapt it. More...
 
std::ostream & GEOM_FADE2D::operator<< (std::ostream &stream, const Point2 &pnt)
 Print to stream.
 
std::istream & GEOM_FADE2D::operator>> (std::istream &stream, Point2 &pnt)
 Stream-to-Point.
 
double GEOM_FADE2D::sqDistance2D (const double x0, const double y0, const Point2 &p1)
 Get the squared distance between two points in 2D.
 
double GEOM_FADE2D::sqDistance2D (const Point2 &p0, const Point2 &p1)
 Get the squared distance between two points in 2D.
 

Function Documentation

◆ center()

Point2 GEOM_FADE2D::center ( const Point2 p0,
const Point2 p1 
)
inline
Note
: The exact midpoint of p0 and p1 may not exist in floating point numbers. Thus the returned point may not be collinear with p0 and p1.

◆ centerWithShift()

Point2 GEOM_FADE2D::centerWithShift ( const Point2 p0,
const Point2 p1 
)

Experimental new function that may change in the future. Thought for specific applications.

This function works like center() but additionally it adapts the midpoint to the segment (p0,p1) such that it is 'as collinear as possible' with p0 and p1 in the x/y plane. Bounds for the shift are 0.01 and 1 % of the range in x- and y-direction.