Click or drag to resize
Accord.NET (logo)

DoublePoint Structure

Structure for representing a pair of coordinates of double type.

Namespace:  Accord
Assembly:  Accord (in Accord.dll) Version: 3.8.0
Syntax
[SerializableAttribute]
public struct DoublePoint
Request Example View Source

The DoublePoint type exposes the following members.

Constructors
  NameDescription
Public methodDoublePoint
Initializes a new instance of the DoublePoint structure.
Top
Methods
  NameDescription
Public methodStatic memberAdd(DoublePoint, DoublePoint)
Addition operator - adds values of two points.
Public methodStatic memberAdd(DoublePoint, Double)
Addition operator - adds scalar to the specified point.
Public methodDistanceTo
Calculate Euclidean distance between two points.
Public methodStatic memberDivide
Division operator - divides coordinates of the specified point by scalar value.
Public methodEquals
Check if this instance of DoublePoint equal to the specified one.
(Overrides ValueTypeEquals(Object).)
Public methodEuclideanNorm
Calculate Euclidean norm of the vector comprised of the point's coordinates - distance from (0, 0) in other words.
Public methodGetHashCode
Get hash code for this instance.
(Overrides ValueTypeGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberMultiply
Multiplication operator - multiplies coordinates of the specified point by scalar value.
Public methodRound
Rounds the double precision point.
Public methodSquaredDistanceTo
Calculate squared Euclidean distance between two points.
Public methodStatic memberSubtract(DoublePoint, DoublePoint)
Subtraction operator - subtracts values of two points.
Public methodStatic memberSubtract(DoublePoint, Double)
Subtraction operator - subtracts scalar from the specified point.
Public methodToString
Get string representation of the class.
(Overrides ValueTypeToString.)
Top
Operators
  NameDescription
Public operatorStatic memberAddition(DoublePoint, DoublePoint)
Addition operator - adds values of two points.
Public operatorStatic memberAddition(DoublePoint, Double)
Addition operator - adds scalar to the specified point.
Public operatorStatic memberDivision
Division operator - divides coordinates of the specified point by scalar value.
Public operatorStatic memberEquality
Equality operator - checks if two points have equal coordinates.
Public operatorStatic member(DoublePoint to IntPoint)
Explicit conversion to IntPoint.
Public operatorStatic member(DoublePoint to Point)
Explicit conversion to Point.
Public operatorStatic memberInequality
Inequality operator - checks if two points have different coordinates.
Public operatorStatic memberMultiply
Multiplication operator - multiplies coordinates of the specified point by scalar value.
Public operatorStatic memberSubtraction(DoublePoint, DoublePoint)
Subtraction operator - subtracts values of two points.
Public operatorStatic memberSubtraction(DoublePoint, Double)
Subtraction operator - subtracts scalar from the specified point.
Top
Fields
  NameDescription
Public fieldX
X coordinate.
Public fieldY
Y coordinate.
Top
Extension Methods
  NameDescription
Public Extension MethodHasMethod
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.)
Public Extension MethodIsEqual
Compares two objects for equality, performing an elementwise comparison if the elements are vectors or matrices.
(Defined by Matrix.)
Public Extension MethodTo(Type)Overloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Public Extension MethodToTOverloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Top
Remarks

The structure is used to store a pair of floating point coordinates with double precision.

Sample usage:

// assigning coordinates in the constructor
DoublePoint p1 = new DoublePoint( 10, 20 );
// creating a point and assigning coordinates later
DoublePoint p2;
p2.X = 30;
p2.Y = 40;
// calculating distance between two points
double distance = p1.DistanceTo( p2 );
See Also