Multi-purpose 2D Point class. More...
Public Member Functions | |
| Point2D (Point2D p) | |
| Create a Point2D from a Point2D. | |
| Point2D (int x, int y) | |
| Create a Point2D from the x and y component. | |
| Point2D (int n) | |
| Create a new instance of the Point2D structure and initialize both components to the same value. | |
| override bool | Equals (object obj) |
| Compares this point with the given obj . | |
| bool | Equals (Point2D rhs) |
| Compares this point with the given rhs one. | |
| override int | GetHashCode () |
| Hash code. | |
| override string | ToString () |
| String conversion. | |
Static Public Member Functions | |
| static Point2D | operator- (Point2D lhs, Point2D rhs) |
| Subtraction operator for PointD structures. | |
| static Point2D | operator+ (Point2D lhs, Point2D rhs) |
| Addition operator for PointD structures. | |
| static bool | operator!= (Point2D lhs, Point2D rhs) |
| Comparison operator for PointD structures. | |
| static bool | operator== (Point2D lhs, Point2D rhs) |
| Comparison operator for PointD structures. | |
| static double | operator* (Point2D lhs, Point2D rhs) |
| Inner product of two PointD structure. | |
| static Point2D | operator* (int lhs, Point2D rhs) |
| Multiply a PointD with a number. | |
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. | |
| 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 |