CVB.Net 14.0
Point2D Struct Reference

Multi-purpose 2D Point class More...

Inherits IEquatable< Point2D >.

## Public Member Functions

Point2D (Point2D p)
Create a Point2D from a Point2D. More...

Point2D (int x, int y)
Create a Point2D from the x and y component. More...

Point2D (int n)
Create a new instance of the Point2D structure and initialize both components to the same value. More...

override bool Equals (object obj)
Compares this point with the given obj . More...

bool Equals (Point2D rhs)
Compares this point with the given rhs one. More...

override int GetHashCode ()
Hash code. More...

override string ToString ()
String conversion. More...

## Static Public Member Functions

static Point2D operator- (Point2D lhs, Point2D rhs)
Subtraction operator for PointD structures. More...

static Point2D operator+ (Point2D lhs, Point2D rhs)
Addition operator for PointD structures. More...

static bool operator!= (Point2D lhs, Point2D rhs)
Comparison operator for PointD structures. More...

static bool operator== (Point2D lhs, Point2D rhs)
Comparison operator for PointD structures. More...

static double operator* (Point2D lhs, Point2D rhs)
Inner product of two PointD structure. More...

static Point2D operator* (int lhs, Point2D rhs)
Multiply a PointD with a number. More...

## Static Public Attributes

static readonly Point2D Empty = new Point2D()
Empty rhs

static readonly Point2D UnitVectorX = new Point2D(1, 0)
Unit rhs in x direction

static readonly Point2D UnitVectorY = new Point2D(0, 1)
Unit rhs in y direction

## Properties

int X` [get, set]`
x component of the rhs

int Y` [get, set]`
y component of the rhs

int this[int row]` [get, set]`
Index access. More...

double Length` [get]`
Gets the length of the vector represented by this PointD object.

## Detailed Description

Multi-purpose 2D Point class

## ◆ Point2D() [1/3]

 Point2D ( Point2D p )

Create a Point2D from a Point2D.

Parameters
 p Point to initialize with

## ◆ Point2D() [2/3]

 Point2D ( int x, int y )

Create a Point2D from the x and y component.

Parameters
 x data to initialize with y data to initialize with

## ◆ Point2D() [3/3]

 Point2D ( int n )

Create a new instance of the Point2D structure and initialize both components to the same value.

Parameters
 n value to initialize `X` and `Y` with.

## ◆ Equals() [1/2]

 override bool Equals ( object obj )

Compares this point with the given obj .

Parameters
 obj Object to compare with.
Returns
`true` if obj is a Point2D and the components are equal.

## ◆ Equals() [2/2]

 bool Equals ( Point2D rhs )

Compares this point with the given rhs one.

Parameters
 rhs Point to compare with.
Returns
`true` if components are equal.

## ◆ GetHashCode()

 override int GetHashCode ( )

Hash code.

Returns
hash code

## ◆ operator!=()

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

Comparison operator for PointD structures.

Parameters
 lhs left hand side operand rhs right hand side operand
Returns
true lhs != rhs, false otherwise

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

 static Point2D operator* ( int lhs, Point2D rhs )
static

Multiply a PointD with a number.

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

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

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

Inner product of two PointD structure.

Parameters
 lhs left hand side vector rhs right hand side vector
Returns
Inner product of lhs and rhs .

## ◆ operator+()

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

Addition operator for PointD structures.

Parameters
 lhs left hand side operand rhs right hand side operand
Returns
Sum of lhs and rhs .

## ◆ operator-()

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

Subtraction operator for PointD structures.

Parameters
 lhs left hand side operand rhs right hand side operand
Returns
Difference of lhs and rhs .

## ◆ operator==()

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

Comparison operator for PointD structures.

Parameters
 lhs left hand side operand rhs right hand side operand
Returns
true lhs == rhs, false otherwise

## ◆ ToString()

 override string ToString ( )

String conversion.

Returns
string representation of this PointD

## ◆ this[int row]

 int this[int row]
getset

Index access.

Parameters
 row The element to access (0 is X).
Returns