Struct representing a 2D point.
More...
#include <Point.h>
Struct representing a 2D point.
The Point structure.
- Examples
- examples/bezier.cpp, examples/clipping.cpp, examples/example1.cpp, examples/example2.cpp, examples/flag.cpp, examples/graph.cpp, examples/holes.cpp, examples/hull.cpp, examples/images.cpp, examples/koch.cpp, examples/logo.cpp, examples/stroke_path.cpp, and examples/tilings.cpp.
◆ Point() [1/3]
LibBoard::Point::Point |
( |
| ) |
|
|
inline |
◆ Point() [2/3]
LibBoard::Point::Point |
( |
const Point & |
other | ) |
|
|
inline |
◆ Point() [3/3]
LibBoard::Point::Point |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
|
inline |
Point constructor.
- Parameters
-
x | The point's first coordinate. |
y | The point's second coordinate. |
◆ argument()
double LibBoard::Point::argument |
( |
| ) |
const |
|
inline |
Return the argument of the point (seen as a complex number).
- Returns
- The argument of the point.
References x, and y.
◆ get()
void LibBoard::Point::get |
( |
double & |
x, |
|
|
double & |
y |
|
) |
| const |
|
inline |
Get the values of the x and y values.
- Parameters
-
x | Reference to the x to be set. |
y | Reference to the y to be set. |
References x, and y.
Referenced by LibBoard::Dot::rotate().
◆ isInf()
bool LibBoard::Point::isInf |
( |
| ) |
const |
|
inline |
Returns true if point is (Inf,Inf).
- Returns
- true if point is (Inf,Inf).
◆ norm()
double LibBoard::Point::norm |
( |
| ) |
const |
|
inline |
◆ normalise()
Point & LibBoard::Point::normalise |
( |
| ) |
|
|
inline |
◆ normalised()
Point LibBoard::Point::normalised |
( |
| ) |
const |
|
inline |
Return a normalized copy of the point (seen as a vector).
- Returns
- A unit vector.
- Examples
- examples/graph.cpp.
References norm().
◆ operator*=()
Point & LibBoard::Point::operator*= |
( |
double |
s | ) |
|
|
inline |
Scale the point's coordinates.
- Parameters
-
- Returns
- The point itself, once scaled.
References x, and y.
◆ operator+=()
Point & LibBoard::Point::operator+= |
( |
const Point & |
other | ) |
|
|
inline |
Move the point given a translation vector (given as another Point).
- Parameters
-
other | A point seen as a translation vector. |
- Returns
- The point itself, once translated.
References x, and y.
◆ operator-()
Point LibBoard::Point::operator- |
( |
| ) |
const |
|
inline |
Get the opposite copy of the point.
- Returns
- The opposite copy of the point.
References Point(), x, and y.
◆ operator-=()
Point & LibBoard::Point::operator-= |
( |
const Point & |
other | ) |
|
|
inline |
Move (backward) the point given a translation vector (given as another Point).
- Parameters
-
other | A point seen as a translation vector. |
- Returns
- The point itself, once translated.
References x, and y.
◆ operator/=()
Point & LibBoard::Point::operator/= |
( |
double |
s | ) |
|
|
inline |
Downscale the point's coordinates.
- Parameters
-
- Returns
- The point itself, once scaled.
References x, and y.
◆ operator=()
Point & LibBoard::Point::operator= |
( |
const Point & |
other | ) |
|
|
inline |
Point assignment operator.
- Parameters
-
References x, and y.
◆ rotate() [1/2]
Point & LibBoard::Point::rotate |
( |
double |
angle | ) |
|
|
inline |
◆ rotate() [2/2]
Point & LibBoard::Point::rotate |
( |
double |
angle, |
|
|
const Point & |
center |
|
) |
| |
|
inline |
Rotate the point, given a rotation center and an angle.
- Parameters
-
angle | The rotation angle (in radians). |
center | The rotation center. |
- Returns
- The point itself (once rotated).
References rotate().
◆ rotated() [1/2]
Point LibBoard::Point::rotated |
( |
double |
angle | ) |
const |
|
inline |
◆ rotated() [2/2]
Point LibBoard::Point::rotated |
( |
double |
angle, |
|
|
const Point & |
center |
|
) |
| const |
|
inline |
Get a rotated copy of the point, given a rotation center and an angle.
- Parameters
-
angle | The rotation angle (in radians). |
center | The rotation center. |
- Returns
- A rotated copy of the point.
References Point().
◆ rotatedPI2()
Point LibBoard::Point::rotatedPI2 |
( |
| ) |
const |
|
inline |
Get a PI/2 rotated copy of the point around (0,0), counterclockwise.
- Returns
- A rotated copy of the point.
- Examples
- examples/stroke_path.cpp.
References Point(), x, and y.
◆ scale()
Point & LibBoard::Point::scale |
( |
double |
sx, |
|
|
double |
sy |
|
) |
| |
|
inline |
Scale the point
- Parameters
-
- Returns
- The point itself, once scaled.
References x, and y.
◆ scaled()
Point LibBoard::Point::scaled |
( |
double |
sx, |
|
|
double |
sy |
|
) |
| |
|
inline |
Return a scaled copy of a point
- Parameters
-
- Returns
- The new point, once scaled.
References Point().
◆ translate()
Point & LibBoard::Point::translate |
( |
double |
dx, |
|
|
double |
dy |
|
) |
| |
|
inline |
◆ translated()
Point LibBoard::Point::translated |
( |
double |
dx, |
|
|
double |
dy |
|
) |
| const |
|
inline |
Return a translated copy of the point
- Parameters
-
dx | Translation along the x axis. |
dy | Translation along the y axis. |
- Returns
- The translated point.
References Point(), x, and y.
Referenced by LibBoard::cross().
double LibBoard::Point::x |
The point's first coordinate
- Examples
- examples/holes.cpp, and examples/hull.cpp.
Referenced by LibBoard::ShapeList::addTiling(), LibBoard::ShapeList::append(), argument(), LibBoard::Ellipse::boundingBox(), LibBoard::Ellipse::flushFIG(), LibBoard::Arrow::flushFIG(), LibBoard::Line::flushFIG(), LibBoard::Ellipse::flushPostscript(), LibBoard::Line::flushPostscript(), LibBoard::GouraudTriangle::flushPostscript(), LibBoard::Ellipse::flushSVG(), LibBoard::Line::flushSVG(), LibBoard::GouraudTriangle::flushSVG(), LibBoard::Ellipse::flushTikZ(), LibBoard::Arrow::flushTikZ(), LibBoard::Line::flushTikZ(), get(), LibBoard::Path::isClockwise(), isSeparing(), LibBoard::Shape::moveCenter(), LibBoard::Path::moveCenter(), norm(), normalise(), operator*=(), operator+=(), operator-(), operator-=(), operator/=(), operator=(), LibBoard::Ellipse::rotate(), rotate(), rotatedPI2(), LibBoard::Group::scale(), LibBoard::Polyline::scale(), LibBoard::ShapeList::scale(), LibBoard::Line::scale(), LibBoard::Board::scale(), scale(), LibBoard::Path::scale(), LibBoard::Line::scaleAll(), translate(), and translated().
double LibBoard::Point::y |
The point's second coordinate
- Examples
- examples/holes.cpp, and examples/hull.cpp.
Referenced by LibBoard::ShapeList::addTiling(), LibBoard::ShapeList::append(), argument(), LibBoard::Ellipse::boundingBox(), LibBoard::Ellipse::flushFIG(), LibBoard::Arrow::flushFIG(), LibBoard::Line::flushFIG(), LibBoard::Ellipse::flushPostscript(), LibBoard::Line::flushPostscript(), LibBoard::GouraudTriangle::flushPostscript(), LibBoard::Ellipse::flushSVG(), LibBoard::Line::flushSVG(), LibBoard::GouraudTriangle::flushSVG(), LibBoard::Ellipse::flushTikZ(), LibBoard::Arrow::flushTikZ(), LibBoard::Line::flushTikZ(), get(), LibBoard::Path::isClockwise(), isSeparing(), LibBoard::Shape::moveCenter(), LibBoard::Path::moveCenter(), norm(), normalise(), operator*=(), operator+=(), operator-(), operator-=(), operator/=(), operator=(), LibBoard::Ellipse::rotate(), rotate(), rotatedPI2(), LibBoard::Group::scale(), LibBoard::Polyline::scale(), LibBoard::ShapeList::scale(), LibBoard::Line::scale(), LibBoard::Board::scale(), scale(), LibBoard::Path::scale(), LibBoard::Line::scaleAll(), translate(), and translated().
The documentation for this struct was generated from the following files: