CVB.Net 15.0
Point2Dd Struct Reference

Multi-purpose 2D Point class More...

Inherits IPosition, and IEquatable< Point2Dd >.

Public Member Functions

 Point2Dd (Point2D pt)
 Create a Point2Dd CvbPointD from a Point2D. More...
 
 Point2Dd (double x, double y)
 Create a Vector2D from the x and y component. More...
 
 Point2Dd (Angle phi, double r)
 Create a PointD vector from radial coordinates. Note that the Point2Dd vectors are internally stored in Cartesian coordinates and that extensive use of radial coordinates my be slow. More...
 
override bool Equals (object obj)
 Compares this point with the given obj . More...
 
bool Equals (Point2Dd rhs)
 Compares this point with the given rhs one. More...
 
override int GetHashCode ()
 Hash code. More...
 
override string ToString ()
 String conversion. More...
 
Point2D ToPoint2D ()
 Converter a PointD to a Point. More...
 

Static Public Member Functions

static Point2Dd operator- (Point2D lhs, Point2Dd rhs)
 Subtraction operator for PointD structures. More...
 
static Point2Dd operator+ (Point2D lhs, Point2Dd rhs)
 Addition operator for PointD structures. More...
 
static Point2Dd operator- (Point2Dd lhs, Point2D rhs)
 Subtraction operator for PointD structures. More...
 
static Point2Dd operator+ (Point2Dd lhs, Point2D rhs)
 Addition operator for PointD structures. More...
 
static Point2Dd operator- (Point2Dd lhs, Point2Dd rhs)
 Subtraction operator for PointD structs. More...
 
static Point2Dd operator+ (Point2Dd lhs, Point2Dd rhs)
 Addition operator for PointD structs. More...
 
static bool operator!= (Point2Dd lhs, Point2Dd rhs)
 Comparison operator for PointD structs. More...
 
static bool operator== (Point2Dd lhs, Point2Dd rhs)
 Comparison operator for PointD structs. More...
 
static Point2Dd operator* (Matrix2D lhs, Point2Dd rhs)
 Multiply a Matrix with a PointD rhs. More...
 
static double operator* (Point2Dd lhs, Point2Dd rhs)
 Inner product of two PointD vectors. More...
 
static Point2Dd operator* (double lhs, Point2Dd rhs)
 Multiply a PointD with a number. More...
 
static Point2Dd operator* (AffineMatrix2D m, Point2Dd p)
 Transform a point using an affine matrix (= coordinate system). More...
 
static Point2Dd operator/ (Point2Dd p, double d)
 Divide a Point2Dd structure by dividing its X and Y component. More...
 

Static Public Attributes

static readonly Point2Dd Empty = new Point2Dd()
 Empty rhs
 
static readonly Point2Dd UnitVectorX = new Point2Dd(1.0, 0.0)
 Unit rhs in x direction
 
static readonly Point2Dd UnitVectorY = new Point2Dd(0.0, 1.0)
 Unit rhs in y direction
 

Properties

double X [get, set]
 x component of the rhs
 
double Y [get, set]
 y component of the rhs
 
double this[int row] [get, set]
 Index access. More...
 
double Length [get, set]
 length of the vector represented by this PointD object.
 
Angle Phi [get, set]
 Orientation of the vector represented by this PointD object.
 
- Properties inherited from IPosition
double X [get]
 X coordinate of the position.
 
double Y [get]
 Y coordinate of the position.
 

Detailed Description

Multi-purpose 2D Point class

Constructor & Destructor Documentation

◆ Point2Dd() [1/3]

Point2Dd ( Point2D  pt)

Create a Point2Dd CvbPointD from a Point2D.

Parameters
ptPoint2D to be converted.

◆ Point2Dd() [2/3]

Point2Dd ( double  x,
double  y 
)

Create a Vector2D from the x and y component.

Parameters
xdata to initialize with
ydata to initialize with

◆ Point2Dd() [3/3]

Point2Dd ( Angle  phi,
double  r 
)

Create a PointD vector from radial coordinates. Note that the Point2Dd vectors are internally stored in Cartesian coordinates and that extensive use of radial coordinates my be slow.

Parameters
phiAngle coordinate.
rRadius coordinate.

Member Function Documentation

◆ Equals() [1/2]

override bool Equals ( object  obj)

Compares this point with the given obj .

Parameters
objObject to compare with.
Returns
true if obj is a Point2Dd and the components are equal.

◆ Equals() [2/2]

bool Equals ( Point2Dd  rhs)

Compares this point with the given rhs one.

Parameters
rhsPoint to compare with.
Returns
true if components are equal.

◆ GetHashCode()

override int GetHashCode ( )

Hash code.

Returns
hash code

◆ operator!=()

static bool operator!= ( Point2Dd  lhs,
Point2Dd  rhs 
)
static

Comparison operator for PointD structs.

Parameters
lhsleft hand side operand
rhsright hand side operand
Returns
true if lhs != rhs, false otherwise.

◆ operator*() [1/4]

static Point2Dd operator* ( AffineMatrix2D  m,
Point2Dd  p 
)
static

Transform a point using an affine matrix (= coordinate system).

Parameters
maffine matrix to transform with
ppoint to transform
Returns
Product of m and p .

◆ operator*() [2/4]

static Point2Dd operator* ( double  lhs,
Point2Dd  rhs 
)
static

Multiply a PointD with a number.

Parameters
rhsrhs to multiply with
lhslhs to multiply with
Returns
Product of lhs and rhs .

◆ operator*() [3/4]

static Point2Dd operator* ( Matrix2D  lhs,
Point2Dd  rhs 
)
static

Multiply a Matrix with a PointD rhs.

Parameters
lhsmatrix
rhsrhs
Returns
Product of lhs and rhs .

◆ operator*() [4/4]

static double operator* ( Point2Dd  lhs,
Point2Dd  rhs 
)
static

Inner product of two PointD vectors.

Parameters
lhsleft hand side vector
rhsright hand side vector
Returns
Inner product of lhs and rhs .

◆ operator+() [1/3]

static Point2Dd operator+ ( Point2D  lhs,
Point2Dd  rhs 
)
static

Addition operator for PointD structures.

Parameters
lhsleft hand side operand
rhsright hand side operand
Returns
Sum of lhs and rhs .

◆ operator+() [2/3]

static Point2Dd operator+ ( Point2Dd  lhs,
Point2D  rhs 
)
static

Addition operator for PointD structures.

Parameters
lhsleft hand side operand
rhsright hand side operand
Returns
Sum of lhs and rhs .

◆ operator+() [3/3]

static Point2Dd operator+ ( Point2Dd  lhs,
Point2Dd  rhs 
)
static

Addition operator for PointD structs.

Parameters
lhsleft hand side operand
rhsright hand side operand
Returns
Sum of lhs and rhs .

◆ operator-() [1/3]

static Point2Dd operator- ( Point2D  lhs,
Point2Dd  rhs 
)
static

Subtraction operator for PointD structures.

Parameters
lhsleft hand side operand
rhsright hand side operand
Returns
Difference of lhs and rhs .

◆ operator-() [2/3]

static Point2Dd operator- ( Point2Dd  lhs,
Point2D  rhs 
)
static

Subtraction operator for PointD structures.

Parameters
lhsleft hand side operand
rhsright hand side operand
Returns
Sum of lhs and rhs .

◆ operator-() [3/3]

static Point2Dd operator- ( Point2Dd  lhs,
Point2Dd  rhs 
)
static

Subtraction operator for PointD structs.

Parameters
lhsleft hand side operand
rhsright hand side operand
Returns
Difference of lhs and rhs .

◆ operator/()

static Point2Dd operator/ ( Point2Dd  p,
double  d 
)
static

Divide a Point2Dd structure by dividing its X and Y component.

Parameters
pPoint to be divided
dDivisor
Returns
Divided point

◆ operator==()

static bool operator== ( Point2Dd  lhs,
Point2Dd  rhs 
)
static

Comparison operator for PointD structs.

Parameters
lhsleft hand side operand
rhsright hand side operand
Returns
true if lhs == rhs, false otherwise.

◆ ToPoint2D()

Point2D ToPoint2D ( )

Converter a PointD to a Point.

Returns
Point representation of this object

◆ ToString()

override string ToString ( )

String conversion.

Returns
string representation of this PointD

Property Documentation

◆ this[int row]

double this[int row]
getset

Index access.

Parameters
rowThe element to access (0 is X).
Returns