#include "common.h"
#include "Vector2.h"
#include <cstring>
Go to the source code of this file.
◆ CINC2
This enumeration describes the possible positions of a point in relation to a circle.
Enumerator |
---|
CINC2_UNKNOWN | Invalid value (undefined)
|
CINC2_ZERO | Point lies exactly on the circumference of the circle.
|
CINC2_INCIRCLE | Point lies inside the circle.
|
CINC2_OUTCIRCLE | Point lies outside the circle.
|
◆ center()
Point2 GEOM_FADE2D::center |
( |
const Point2 & |
p0, |
|
|
const Point2 & |
p1 |
|
) |
| |
|
inline |
This function calculates the midpoint between two given points, p0
and p1
.
- Parameters
-
p0 | First point |
p1 | Second point |
- Returns
- The computed midpoint
- Note
- The exact midpoint of
p0
and p1
may not exist in floating-point numbers due to limited precision. As a result, the returned point may not be perfectly collinear with p0
and p1
.
◆ operator<<()
std::ostream& GEOM_FADE2D::operator<< |
( |
std::ostream & |
stream, |
|
|
const Point2 & |
pnt |
|
) |
| |
|
inline |
Prints a Point2 to an output stream.
- Parameters
-
stream | The output stream. |
pnt | The Point2 to be printed. |
- Returns
- The output stream.
◆ operator>>()
std::istream& GEOM_FADE2D::operator>> |
( |
std::istream & |
stream, |
|
|
Point2 & |
pnt |
|
) |
| |
|
inline |
Reads coordinates from a stream into a Point2.
- Parameters
-
stream | The input stream. |
pnt | The Point2 to be populated with data. |
- Returns
- The input stream.
◆ sqDistance2D() [1/2]
double GEOM_FADE2D::sqDistance2D |
( |
const double |
x0, |
|
|
const double |
y0, |
|
|
const Point2 & |
p1 |
|
) |
| |
|
inline |
Computes the squared distance between two points
- Parameters
-
x0,y0 | The coordinates of the first point |
p1 | The second point |
- Returns
- The squared 2D distance between the specified points.
◆ sqDistance2D() [2/2]
double GEOM_FADE2D::sqDistance2D |
( |
const Point2 & |
p0, |
|
|
const Point2 & |
p1 |
|
) |
| |
|
inline |
Computes the squared distance between two points
- Parameters
-
p0,p1 | The Point2 objects whose squared distance is to be computed |
- Returns
- The squared 2D distance between
p0
and p1
.