RDKit: RDGeom::Point2D Class Reference

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
RDGeom::Point2D Class Reference

`#include <point.h>`

Inheritance diagram for RDGeom::Point2D:

## Public Member Functions
constexpr | Point2D ()
constexpr | Point2D (double xv, double yv)
constexpr | ~Point2D () override
constexpr | Point2D (const Point2D &other)
constexpr | Point2D (const Point3D &p3d)
| construct from a Point3D (ignoring the z coordinate)
constexpr Point * | copy () const override
constexpr unsigned int | dimension () const override
constexpr double | operator[] (unsigned int i) const override
constexpr double & | operator[] (unsigned int i) override
constexpr Point2D & | operator= (const Point2D &other)
constexpr Point2D & | operator+= (const Point2D &other)
constexpr Point2D & | operator-= (const Point2D &other)
constexpr Point2D & | operator*= (double scale)
constexpr Point2D & | operator/= (double scale)
constexpr Point2D | operator- () const
void | normalize () override
constexpr void | rotate90 ()
double | length () const override
constexpr double | lengthSq () const override
constexpr double | dotProduct (const Point2D &other) const
double | angleTo (const Point2D &other) const
double | signedAngleTo (const Point2D &other) const
Point2D | directionVector (const Point2D &other) const
Public Member Functions inherited from RDGeom::Point
virtual constexpr | ~Point ()

## Public Attributes
double | x {0.0}
double | y {0.0}

## Detailed Description

Definition at line 284 of file point.h.

## Constructor & Destructor Documentation

## ◆ Point2D() [1/4]

RDGeom::Point2D::Point2D | ( |  | ) |
| inlineconstexpr

Definition at line 289 of file point.h.

Referenced by angleTo(), copy(), directionVector(), dotProduct(), operator*=(), operator+=(), operator-(), operator-=(), operator/=(), operator=(), Point2D(), and signedAngleTo().

## ◆ Point2D() [2/4]

RDGeom::Point2D::Point2D | ( | double | xv,
|  | double | yv )
| inlineconstexpr

Definition at line 290 of file point.h.

References x, and y.

## ◆ ~Point2D()

RDGeom::Point2D::~Point2D | ( |  | ) |
| inlineconstexproverride

Definition at line 291 of file point.h.

## ◆ Point2D() [3/4]

RDGeom::Point2D::Point2D | ( | const Point2D & | other | ) |
| inlineconstexpr

Definition at line 293 of file point.h.

References Point2D(), x, and y.

## ◆ Point2D() [4/4]

RDGeom::Point2D::Point2D | ( | const Point3D & | p3d | ) |
| inlineconstexpr

construct from a Point3D (ignoring the z coordinate)

Definition at line 296 of file point.h.

References x, and y.

## Member Function Documentation

## ◆ angleTo()

double RDGeom::Point2D::angleTo | ( | const Point2D & | other | ) | const
| inline

Definition at line 397 of file point.h.

References normalize(), and Point2D().

Referenced by RDDepict::computeAngle(), and signedAngleTo().

## ◆ copy()

Point * RDGeom::Point2D::copy | ( |  | ) | const
| inlinenodiscardconstexproverridevirtual

Implements RDGeom::Point.

Definition at line 298 of file point.h.

References Point2D().

## ◆ dimension()

unsigned int RDGeom::Point2D::dimension | ( |  | ) | const
| inlineconstexproverridevirtual

Implements RDGeom::Point.

Definition at line 302 of file point.h.

## ◆ directionVector()

Point2D RDGeom::Point2D::directionVector | ( | const Point2D & | other | ) | const
| inline

Definition at line 420 of file point.h.

References normalize(), Point2D(), x, and y.

## ◆ dotProduct()

double RDGeom::Point2D::dotProduct | ( | const Point2D & | other | ) | const
| inlineconstexpr

Definition at line 392 of file point.h.

References Point2D(), x, and y.

## ◆ length()

double RDGeom::Point2D::length | ( |  | ) | const
| inlineoverridevirtual

Implements RDGeom::Point.

Definition at line 381 of file point.h.

References x, and y.

Referenced by normalize().

## ◆ lengthSq()

double RDGeom::Point2D::lengthSq | ( |  | ) | const
| inlineconstexproverridevirtual

Implements RDGeom::Point.

Definition at line 387 of file point.h.

References x, and y.

## ◆ normalize()

void RDGeom::Point2D::normalize | ( |  | ) |
| inlineoverridevirtual

Implements RDGeom::Point.

Definition at line 365 of file point.h.

References length(), x, y, and zero_tolerance.

Referenced by angleTo(), RDDepict::computeNormal(), and directionVector().

## ◆ operator*=()

Point2D & RDGeom::Point2D::operator*= | ( | double | scale | ) |
| inlineconstexpr

Definition at line 346 of file point.h.

References Point2D(), x, and y.

## ◆ operator+=()

Point2D & RDGeom::Point2D::operator+= | ( | const Point2D & | other | ) |
| inlineconstexpr

Definition at line 334 of file point.h.

References Point2D(), x, and y.

## ◆ operator-()

Point2D RDGeom::Point2D::operator- | ( |  | ) | const
| inlineconstexpr

Definition at line 358 of file point.h.

References Point2D(), x, and y.

## ◆ operator-=()

Point2D & RDGeom::Point2D::operator-= | ( | const Point2D & | other | ) |
| inlineconstexpr

Definition at line 340 of file point.h.

References Point2D(), x, and y.

## ◆ operator/=()

Point2D & RDGeom::Point2D::operator/= | ( | double | scale | ) |
| inlineconstexpr

Definition at line 352 of file point.h.

References Point2D(), x, and y.

## ◆ operator=()

Point2D & RDGeom::Point2D::operator= | ( | const Point2D & | other | ) |
| inlineconstexpr

Definition at line 328 of file point.h.

References Point2D(), x, and y.

## ◆ operator[]() [1/2]

double RDGeom::Point2D::operator[] | ( | unsigned int | i | ) | const
| inlineconstexproverridevirtual

Implements RDGeom::Point.

Definition at line 304 of file point.h.

References x, and y.

## ◆ operator[]() [2/2]

double & RDGeom::Point2D::operator[] | ( | unsigned int | i | ) |
| inlineconstexproverridevirtual

Implements RDGeom::Point.

Definition at line 316 of file point.h.

References x, and y.

## ◆ rotate90()

void RDGeom::Point2D::rotate90 | ( |  | ) |
| inlineconstexpr

Definition at line 375 of file point.h.

References x, and y.

## ◆ signedAngleTo()

double RDGeom::Point2D::signedAngleTo | ( | const Point2D & | other | ) | const
| inline

Definition at line 412 of file point.h.

References angleTo(), M_PI, Point2D(), x, y, and zero_tolerance.

## Member Data Documentation

## ◆ x

double RDGeom::Point2D::x {0.0}

Definition at line 286 of file point.h.

Referenced by directionVector(), dotProduct(), RDKit::MolDraw2Dwx::drawChar(), RDKit::MolDraw2Dwx::drawLine(), RDKit::MolDraw2Dwx::drawPolygon(), length(), lengthSq(), normalize(), operator*=(), operator+=(), operator-(), operator-=(), operator/=(), operator=(), operator[](), operator[](), Point2D(), Point2D(), Point2D(), rotate90(), RDDepict::rotationDir(), and signedAngleTo().

## ◆ y

double RDGeom::Point2D::y {0.0}

Definition at line 287 of file point.h.

Referenced by directionVector(), dotProduct(), RDKit::MolDraw2Dwx::drawChar(), RDKit::MolDraw2Dwx::drawLine(), RDKit::MolDraw2Dwx::drawPolygon(), length(), lengthSq(), normalize(), operator*=(), operator+=(), operator-(), operator-=(), operator/=(), operator=(), operator[](), operator[](), Point2D(), Point2D(), Point2D(), rotate90(), and signedAngleTo().

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

- point.h