# LibBoard::Point Struct Reference

Struct representing a 2D point. More...

`#include <Point.h>`

List of all members.

## Public Member Functions

| Point ()
| Point (const Point &other)
| Point (double x, double y)
Point & | rotate (double angle)
void | get (double &x, double &y) const
Point | rotated (double angle) const
Point & | rotate (double angle, const Point &center)
Point & | rotated (double angle, const Point &center) const
Point & | operator+= (const Point &other)
Point & | operator-= (const Point &other)
Point & | operator*= (double s)
Point & | operator/= (double s)
Point | operator- ()
double | norm () const

## Public Attributes

double | x
double | y

## Detailed Description

Struct representing a 2D point.

The Point structure.

Examples:

  examples/clipping.cpp, examples/example1.cpp, examples/example2.cpp, examples/koch.cpp, and examples/logo.cpp.

## Constructor & Destructor Documentation

LibBoard::Point::Point | ( |  | ) | `[inline]`

Point constructor.

Parameters:

  | x | The point's first coordinate.
  | y | The point's second coordinate.

Referenced by rotated().

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.

## Member Function Documentation

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.

Point & LibBoard::Point::rotate | ( | double | angle | ) | `[inline]`

Rotate the point with a given angle around the origin (0,0)

Parameters:

  | angle | The rotation angle.

References x, and y.

Referenced by LibBoard::Text::rotate(), and LibBoard::Circle::rotate().

Point LibBoard::Point::rotated | ( | double | angle | ) | const`[inline]`

Rotate the point with a given angle around the origin (0,0)

Parameters:

  | angle | The rotation angle.

Returns:
  The rotated point.

Examples:
  examples/koch.cpp.

References Point().

Referenced by LibBoard::Ellipse::rotate().

## Member Data Documentation

double LibBoard::Point::x

The point's first coordinate

Referenced by LibBoard::Text::boundingBox(), LibBoard::Ellipse::boundingBox(), LibBoard::Board::drawTriangle(), LibBoard::Board::fillGouraudTriangle(), LibBoard::Board::fillTriangle(), LibBoard::Text::flushFIG(), LibBoard::Ellipse::flushFIG(), LibBoard::Text::flushPostscript(), LibBoard::GouraudTriangle::flushPostscript(), LibBoard::Ellipse::flushPostscript(), LibBoard::Text::flushSVG(), LibBoard::GouraudTriangle::flushSVG(), LibBoard::Circle::flushSVG(), LibBoard::Ellipse::flushSVG(), get(), LibBoard::Text::rotate(), LibBoard::Ellipse::rotate(), rotate(), LibBoard::Line::scale(), LibBoard::Group::scale(), LibBoard::ShapeList::scale(), LibBoard::Path::scale(), LibBoard::Board::scale(), LibBoard::Arrow::scaled(), and LibBoard::Line::scaled().

double LibBoard::Point::y

The point's second coordinate

Referenced by LibBoard::Text::boundingBox(), LibBoard::Ellipse::boundingBox(), LibBoard::Board::drawTriangle(), LibBoard::Board::fillGouraudTriangle(), LibBoard::Board::fillTriangle(), LibBoard::Text::flushFIG(), LibBoard::Ellipse::flushFIG(), LibBoard::Text::flushPostscript(), LibBoard::GouraudTriangle::flushPostscript(), LibBoard::Ellipse::flushPostscript(), LibBoard::Text::flushSVG(), LibBoard::GouraudTriangle::flushSVG(), LibBoard::Circle::flushSVG(), LibBoard::Ellipse::flushSVG(), get(), LibBoard::Text::rotate(), LibBoard::Ellipse::rotate(), rotate(), LibBoard::Line::scale(), LibBoard::Group::scale(), LibBoard::ShapeList::scale(), LibBoard::Path::scale(), LibBoard::Board::scale(), LibBoard::Arrow::scaled(), and LibBoard::Line::scaled().

The documentation for this struct was generated from the following file:

- include/board/Point.h