fastjet 2.4.3
Public Member Functions | Public Attributes | Friends

Coord2D Class Reference

class for representing 2d coordinates and carrying out some basic operations on them More...

#include <ClosestPair2DBase.hh>

List of all members.

Public Member Functions

 Coord2D ()
 Coord2D (double a, double b)
Coord2D operator- (const Coord2D &other) const
 return the vector difference between two coordinates
Coord2D operator+ (const Coord2D &other) const
 return the vector sum between two coordinates
Coord2D operator* (double factor) const
 return the product of the coordinate with the factor
Coord2D operator/ (double divisor) const
 division of each component of coordinate
double distance2 (const Coord2D &b) const
 return the squared distance between two coordinates

Public Attributes

double x
double y

Friends

Coord2D operator* (double factor, const Coord2D &coord)
double distance2 (const Coord2D &a, const Coord2D &b)
 return the squared distance between two coordinates

Detailed Description

class for representing 2d coordinates and carrying out some basic operations on them

Definition at line 42 of file ClosestPair2DBase.hh.


Constructor & Destructor Documentation

Coord2D::Coord2D ( ) [inline]

Definition at line 46 of file ClosestPair2DBase.hh.

Referenced by operator*(), operator+(), operator-(), and operator/().

{};
Coord2D::Coord2D ( double  a,
double  b 
) [inline]

Definition at line 48 of file ClosestPair2DBase.hh.

: x(a), y(b) {};

Member Function Documentation

double Coord2D::distance2 ( const Coord2D b) const [inline]

return the squared distance between two coordinates

Definition at line 74 of file ClosestPair2DBase.hh.

References x, and y.

                                            {
    double dx = x - b.x, dy = y-b.y;
    return dx*dx+dy*dy;
  };
Coord2D Coord2D::operator* ( double  factor) const [inline]

return the product of the coordinate with the factor

Definition at line 59 of file ClosestPair2DBase.hh.

References Coord2D(), x, and y.

{return Coord2D(factor*x,factor*y);};
Coord2D Coord2D::operator+ ( const Coord2D other) const [inline]

return the vector sum between two coordinates

Definition at line 55 of file ClosestPair2DBase.hh.

References Coord2D(), x, and y.

                                                 {
    return Coord2D(x + other.x,  y + other.y);};
Coord2D Coord2D::operator- ( const Coord2D other) const [inline]

return the vector difference between two coordinates

Definition at line 51 of file ClosestPair2DBase.hh.

References Coord2D(), x, and y.

                                                 {
    return Coord2D(x - other.x,  y - other.y);};
Coord2D Coord2D::operator/ ( double  divisor) const [inline]

division of each component of coordinate

Definition at line 65 of file ClosestPair2DBase.hh.

References Coord2D(), x, and y.

                                          {
    return Coord2D(x / divisor,  y / divisor);};

Friends And Related Function Documentation

double distance2 ( const Coord2D a,
const Coord2D b 
) [friend]

return the squared distance between two coordinates

Definition at line 69 of file ClosestPair2DBase.hh.

Referenced by ClosestPair2D::Point::distance2().

                                                                {
    double dx = a.x - b.x, dy = a.y-b.y;
    return dx*dx+dy*dy;
  };
Coord2D operator* ( double  factor,
const Coord2D coord 
) [friend]

Definition at line 60 of file ClosestPair2DBase.hh.

                                                                 {
    return Coord2D(factor*coord.x,factor*coord.y);
  }

Member Data Documentation

double Coord2D::x
double Coord2D::y

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