Struct representing a 2D point.
More...
#include <Point.h>
LibBoard::Point::Point |
( |
| ) |
|
|
inline |
LibBoard::Point::Point |
( |
const Point & |
other | ) |
|
|
inline |
Point constructor.
- Parameters
-
x | The point's first coordinate. |
y | The point's second coordinate. |
LibBoard::Point::Point |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
|
inline |
Point constructor.
- Parameters
-
x | The point's first coordinate. |
y | The point's second coordinate. |
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.
void LibBoard::Point::get |
( |
double & |
x, |
|
|
double & |
y |
|
) |
| const |
|
inline |
bool LibBoard::Point::isInf |
( |
| ) |
const |
|
inline |
Returns true if point is (Inf,Inf).
- Returns
- true if point is (Inf,Inf).
double LibBoard::Point::norm |
( |
| ) |
const |
|
inline |
Point & LibBoard::Point::normalise |
( |
| ) |
|
|
inline |
Point LibBoard::Point::normalised |
( |
| ) |
const |
|
inline |
Return a normalized copy of the point (seen as a vector).
- Returns
- A unit vector.
References norm().
Point & LibBoard::Point::operator*= |
( |
double |
s | ) |
|
|
inline |
Scale the point's coordinates.
- Parameters
-
- Returns
- The point itself, once scaled.
References x, and y.
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.
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.
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.
Point & LibBoard::Point::operator/= |
( |
double |
s | ) |
|
|
inline |
Downscale the point's coordinates.
- Parameters
-
- Returns
- The point itself, once scaled.
References x, and y.
Point & LibBoard::Point::rotate |
( |
double |
angle | ) |
|
|
inline |
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().
Point LibBoard::Point::rotated |
( |
double |
angle | ) |
const |
|
inline |
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().
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.
double LibBoard::Point::x |
The point's first coordinate
Referenced by LibBoard::ShapeList::addTiling(), LibBoard::ShapeList::append(), argument(), LibBoard::Ellipse::boundingBox(), LibBoard::Board::drawArrow(), LibBoard::Board::drawLine(), LibBoard::Board::drawTriangle(), LibBoard::Board::fillTriangle(), LibBoard::Ellipse::flushFIG(), LibBoard::GouraudTriangle::flushPostscript(), LibBoard::Ellipse::flushPostscript(), LibBoard::GouraudTriangle::flushSVG(), LibBoard::Ellipse::flushSVG(), LibBoard::Circle::flushSVG(), LibBoard::Ellipse::flushTikZ(), LibBoard::Circle::flushTikZ(), get(), LibBoard::Board::makeGrid(), LibBoard::Shape::moveCenter(), norm(), normalise(), operator*=(), operator+=(), operator-(), operator-=(), operator/=(), rotate(), LibBoard::Ellipse::rotate(), rotatedPI2(), LibBoard::ShapeList::scale(), LibBoard::Board::scale(), LibBoard::Path::scale(), LibBoard::Group::scale(), and LibBoard::Line::scale().
double LibBoard::Point::y |
The point's second coordinate
Referenced by LibBoard::ShapeList::addTiling(), LibBoard::ShapeList::append(), argument(), LibBoard::Ellipse::boundingBox(), LibBoard::Board::drawArrow(), LibBoard::Board::drawLine(), LibBoard::Board::drawTriangle(), LibBoard::Board::fillTriangle(), LibBoard::Ellipse::flushFIG(), LibBoard::GouraudTriangle::flushPostscript(), LibBoard::Ellipse::flushPostscript(), LibBoard::GouraudTriangle::flushSVG(), LibBoard::Ellipse::flushSVG(), LibBoard::Circle::flushSVG(), LibBoard::Ellipse::flushTikZ(), LibBoard::Circle::flushTikZ(), get(), LibBoard::Board::makeGrid(), LibBoard::Shape::moveCenter(), norm(), normalise(), operator*=(), operator+=(), operator-(), operator-=(), operator/=(), rotate(), LibBoard::Ellipse::rotate(), rotatedPI2(), LibBoard::ShapeList::scale(), LibBoard::Board::scale(), LibBoard::Path::scale(), LibBoard::Group::scale(), and LibBoard::Line::scale().
The documentation for this struct was generated from the following files: