RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
RDGeom::Point2D Class Reference

#include <point.h>

Inheritance diagram for RDGeom::Point2D:
RDGeom::Point

Public Member Functions

 Point2D ()
 
 Point2D (double xv, double yv)
 
 ~Point2D () override=default
 
 Point2D (const Point2D &other)
 
 Point2D (const Point3D &p3d)
 construct from a Point3D (ignoring the z coordinate)
 
Pointcopy () const override
 
unsigned int dimension () const override
 
double operator[] (unsigned int i) const override
 
double & operator[] (unsigned int i) override
 
Point2Doperator= (const Point2D &other)
 
Point2Doperator+= (const Point2D &other)
 
Point2Doperator-= (const Point2D &other)
 
Point2Doperator*= (double scale)
 
Point2Doperator/= (double scale)
 
Point2D operator- () const
 
void normalize () override
 
void rotate90 ()
 
double length () const override
 
double lengthSq () const override
 
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 ~Point ()
 

Public Attributes

double x {0.0}
 
double y {0.0}
 

Detailed Description

Definition at line 274 of file point.h.

Constructor & Destructor Documentation

◆ Point2D() [1/4]

RDGeom::Point2D::Point2D ( )
inline

Definition at line 279 of file point.h.

◆ Point2D() [2/4]

RDGeom::Point2D::Point2D ( double xv,
double yv )
inline

Definition at line 280 of file point.h.

◆ ~Point2D()

RDGeom::Point2D::~Point2D ( )
overridedefault

◆ Point2D() [3/4]

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

Definition at line 283 of file point.h.

◆ Point2D() [4/4]

RDGeom::Point2D::Point2D ( const Point3D & p3d)
inline

construct from a Point3D (ignoring the z coordinate)

Definition at line 285 of file point.h.

Member Function Documentation

◆ angleTo()

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

Definition at line 374 of file point.h.

References dotProduct(), and normalize().

Referenced by RDDepict::computeAngle().

◆ copy()

Point * RDGeom::Point2D::copy ( ) const
inlineoverridevirtual

Implements RDGeom::Point.

Definition at line 287 of file point.h.

◆ dimension()

unsigned int RDGeom::Point2D::dimension ( ) const
inlineoverridevirtual

Implements RDGeom::Point.

Definition at line 289 of file point.h.

◆ directionVector()

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

Definition at line 398 of file point.h.

References normalize(), x, and y.

◆ dotProduct()

double RDGeom::Point2D::dotProduct ( const Point2D & other) const
inline

Definition at line 369 of file point.h.

References x, and y.

Referenced by angleTo().

◆ length()

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

Implements RDGeom::Point.

Definition at line 358 of file point.h.

◆ lengthSq()

double RDGeom::Point2D::lengthSq ( ) const
inlineoverridevirtual

Implements RDGeom::Point.

Definition at line 364 of file point.h.

◆ normalize()

void RDGeom::Point2D::normalize ( )
inlineoverridevirtual

Implements RDGeom::Point.

Definition at line 346 of file point.h.

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

◆ operator*=()

Point2D & RDGeom::Point2D::operator*= ( double scale)
inline

Definition at line 327 of file point.h.

◆ operator+=()

Point2D & RDGeom::Point2D::operator+= ( const Point2D & other)
inline

Definition at line 315 of file point.h.

References x, and y.

◆ operator-()

Point2D RDGeom::Point2D::operator- ( ) const
inline

Definition at line 339 of file point.h.

References x, and y.

◆ operator-=()

Point2D & RDGeom::Point2D::operator-= ( const Point2D & other)
inline

Definition at line 321 of file point.h.

References x, and y.

◆ operator/=()

Point2D & RDGeom::Point2D::operator/= ( double scale)
inline

Definition at line 333 of file point.h.

◆ operator=()

Point2D & RDGeom::Point2D::operator= ( const Point2D & other)
inline

Definition at line 309 of file point.h.

References x, and y.

◆ operator[]() [1/2]

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

Implements RDGeom::Point.

Definition at line 291 of file point.h.

References PRECONDITION.

◆ operator[]() [2/2]

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

Implements RDGeom::Point.

Definition at line 300 of file point.h.

References PRECONDITION.

◆ rotate90()

void RDGeom::Point2D::rotate90 ( )
inline

Definition at line 352 of file point.h.

◆ signedAngleTo()

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

Definition at line 390 of file point.h.

References M_PI, x, and y.

Member Data Documentation

◆ x

◆ y


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