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. | |
Multi-purpose 2D Point class
Point2D | ( | int | x, |
int | y | ||
) |
Create a Point2D from the x and y component.
x | data to initialize with |
y | data to initialize with |
Point2D | ( | int | n | ) |
Create a new instance of the Point2D structure and initialize both components to the same value.
n | value to initialize X and Y with. |
override bool Equals | ( | object | obj | ) |
Compares this point with the given obj .
obj | Object to compare with. |
true
if obj is a Point2D and the components are equal.bool Equals | ( | Point2D | rhs | ) |
Compares this point with the given rhs one.
rhs | Point to compare with. |
true
if components are equal.override int GetHashCode | ( | ) |
Hash code.
Comparison operator for PointD structures.
lhs | left hand side operand |
rhs | right hand side operand |
Multiply a PointD with a number.
rhs | rhs to multiply with |
lhs | lhs to multiply with |
Inner product of two PointD structure.
lhs | left hand side vector |
rhs | right hand side vector |
Addition operator for PointD structures.
lhs | left hand side operand |
rhs | right hand side operand |
Subtraction operator for PointD structures.
lhs | left hand side operand |
rhs | right hand side operand |
Comparison operator for PointD structures.
lhs | left hand side operand |
rhs | right hand side operand |
override string ToString | ( | ) |
String conversion.
|
getset |