Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

ogdf::DVector Class Reference

Vectors with real coordinates. More...

#include <ogdf/basic/geometry.h>

+ Inheritance diagram for ogdf::DVector:

Public Member Functions

 DVector ()
 Creates a vector (0,0). More...
 
 DVector (double x, double y)
 Creates a vector (x,y). More...
 
 DVector (const DVector &dv)
 Copy constructor. More...
 
 DVector (const DPoint &dv)
 Copy constructor from DPoint. More...
 
double length () const
 Returns the length of the vector. More...
 
DVector operator* (const double val) const
 Multiplies all coordinates with val. More...
 
double operator* (const DVector &dv) const
 Returns the scalar product of this vecor and dv. More...
 
DVector operator+ (const DVector &dv) const
 Addition of vectors. More...
 
DVector operator- (const DVector &dv) const
 Subtraction of vectors. More...
 
DVector operator/ (const double val) const
 Divides all coordinates by val. More...
 
DVector operator= (const DPoint &ip)
 Assignment operator. More...
 
double operator^ (const DVector &dv) const
 Returns the determinante of the vector. More...
 
DVector orthogonal () const
 Returns a vector that is orthogonal to this vector. More...
 
- Public Member Functions inherited from ogdf::DPoint
 DPoint ()
 Creates a real point (0,0). More...
 
 DPoint (double x, double y)
 Creates a real point (x,y). More...
 
 DPoint (const DPoint &dp)
 Copy constructor. More...
 
double distance (const DPoint &p) const
 Returns the euclidean distance between p and this point. More...
 
double norm () const
 Returns the norm of the point. More...
 
DPoint & operator*= (double c)
 
DPoint operator+ (const DPoint &p) const
 Addition of real points. More...
 
DPoint & operator+= (const DPoint &p)
 
DPoint operator- (const DPoint &p) const
 Subtraction of real points. More...
 
DPoint & operator-= (const DPoint &p)
 
DPoint & operator/= (double c)
 
bool operator== (const DPoint &dp) const
 Relaxed equality operator. More...
 
- Public Member Functions inherited from ogdf::GenericPoint< double >
 GenericPoint ()
 Creates a generic point. More...
 
 GenericPoint (double x, double y)
 Creates a generic point (x,y). More...
 
 GenericPoint (const GenericPoint &p)
 Copy constructor. More...
 
double angle (GenericPoint q, GenericPoint r) const
 Compute angle (in radians) between vectors. More...
 
double angleDegrees (GenericPoint q, GenericPoint r) const
 Compute angle (in degrees) between vectors. More...
 
bool operator!= (const GenericPoint &p) const
 Inequality operator. More...
 
bool operator< (const GenericPoint &p)
 
GenericPoint & operator= (const GenericPoint &p)
 Assignment operator. More...
 
bool operator== (const GenericPoint &p) const
 Equality operator. More...
 
bool operator> (const GenericPoint &p)
 

Additional Inherited Members

- Public Types inherited from ogdf::GenericPoint< double >
using numberType = double
 The type for coordinates of the point. More...
 
- Public Attributes inherited from ogdf::GenericPoint< double >
double m_x
 The x-coordinate. More...
 
double m_y
 The y-coordinate. More...
 

Detailed Description

Vectors with real coordinates.

Definition at line 286 of file geometry.h.

Constructor & Destructor Documentation

◆ DVector() [1/4]

ogdf::DVector::DVector ( )
inline

Creates a vector (0,0).

Definition at line 290 of file geometry.h.

◆ DVector() [2/4]

ogdf::DVector::DVector ( double  x,
double  y 
)
inline

Creates a vector (x,y).

Definition at line 293 of file geometry.h.

◆ DVector() [3/4]

ogdf::DVector::DVector ( const DVector &  dv)
inline

Copy constructor.

Definition at line 296 of file geometry.h.

◆ DVector() [4/4]

ogdf::DVector::DVector ( const DPoint &  dv)
inline

Copy constructor from DPoint.

Definition at line 299 of file geometry.h.

Member Function Documentation

◆ length()

double ogdf::DVector::length ( ) const

Returns the length of the vector.

◆ operator*() [1/2]

DVector ogdf::DVector::operator* ( const double  val) const

Multiplies all coordinates with val.

◆ operator*() [2/2]

double ogdf::DVector::operator* ( const DVector &  dv) const

Returns the scalar product of this vecor and dv.

◆ operator+()

DVector ogdf::DVector::operator+ ( const DVector &  dv) const

Addition of vectors.

◆ operator-()

DVector ogdf::DVector::operator- ( const DVector &  dv) const

Subtraction of vectors.

◆ operator/()

DVector ogdf::DVector::operator/ ( const double  val) const

Divides all coordinates by val.

◆ operator=()

DVector ogdf::DVector::operator= ( const DPoint &  ip)
inline

Assignment operator.

Definition at line 302 of file geometry.h.

◆ operator^()

double ogdf::DVector::operator^ ( const DVector &  dv) const

Returns the determinante of the vector.

◆ orthogonal()

DVector ogdf::DVector::orthogonal ( ) const

Returns a vector that is orthogonal to this vector.

Returns the vector (y/x,1) if x != 0, or (1,0) otherwise, where (x,y) is this vector.


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