Code Packages  1
Add-on code processing modules
Public Member Functions | Static Public Member Functions | Properties | List of all members
dsp.Point Struct Reference

Provides an immutable 2D point data type More...

Public Member Functions

 Point (double x, double y)
 Initialize a new instance of the Point type using the specified coordinates More...
 
 Point (string s)
 Creates a point from string coordinates More...
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
override string ToString ()
 Converts a point to its equivalent string representation More...
 

Static Public Member Functions

static bool operator!= (Point A, Point B)
 Inequality check of two Points More...
 
static bool operator== (Point A, Point B)
 Equality check of two points More...
 

Properties

double X [get]
 Gets the X coordinate of the point More...
 
double Y [get]
 Gets the Y coordinate of the point More...
 

Detailed Description

Provides an immutable 2D point data type

Constructor & Destructor Documentation

◆ Point() [1/2]

dsp.Point.Point ( double  x,
double  y 
)

Initialize a new instance of the Point type using the specified coordinates

Parameters
xX coordinate
yY coordinate

Example

Point p = new Point(1,1);
Console.WriteLine(p);
1 1

◆ Point() [2/2]

dsp.Point.Point ( string  s)

Creates a point from string coordinates

Parameters
sstring representing a point

Example

Point p = new Point("2,4");
Console.WriteLine(p);
2 4

Member Function Documentation

◆ Equals()

override bool dsp.Point.Equals ( object  obj)

◆ GetHashCode()

override int dsp.Point.GetHashCode ( )

◆ operator!=()

static bool dsp.Point.operator!= ( Point  A,
Point  B 
)
static

Inequality check of two Points

Parameters
Afirst point
Bsecond point

Example

Point p1 = new Point(2,2);
Point p2 = new Point(-2,2);
Console.WriteLine(p1 != p2);
True

◆ operator==()

static bool dsp.Point.operator== ( Point  A,
Point  B 
)
static

Equality check of two points

Parameters
Afirst point
Bsecond point

Example

Point p1 = new Point(2,2);
Point p2 = new Point(2,2);
Console.WriteLine(p1 == p2);
True

◆ ToString()

override string dsp.Point.ToString ( )

Converts a point to its equivalent string representation

Example

Point p = new Point(1,2);
Console.WriteLine(p);
1 2

Property Documentation

◆ X

double dsp.Point.X
get

Gets the X coordinate of the point

Example

Point p = new Point(4,1);
Console.WriteLine(p.X);
4

◆ Y

double dsp.Point.Y
get

Gets the Y coordinate of the point

Example

Point p = new Point(4,1);
Console.WriteLine(p.Y);
1