Generated by DocFX

Class Point

Structure for representing a pair of coordinates of double, decimal, double or int type.

Inheritance
System.Object
Point
Namespace: ISynergy.Framework.Core.Points
Assembly: ISynergy.Framework.Core.dll
Syntax
public class Point : IComparable<Point>
Remarks

The structure is used to store a pair of numeric point coordinates with single precision.

Sample usage:

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

Constructors

View Source

Point(Decimal, Decimal, Boolean, Int32)

Initializes a new instance of the Point structure.

Declaration
public Point(decimal x, decimal y, bool round = false, int decimals = 0)
Parameters
Type Name Description
System.Decimal x

X axis coordinate.

System.Decimal y

Y axis coordinate.

System.Boolean round
System.Int32 decimals
View Source

Point(Double, Double, Boolean, Int32)

Initializes a new instance of the Point structure.

Declaration
public Point(double x, double y, bool round = false, int decimals = 0)
Parameters
Type Name Description
System.Double x

X axis coordinate.

System.Double y

Y axis coordinate.

System.Boolean round
System.Int32 decimals
View Source

Point(Int32, Int32, Boolean, Int32)

Initializes a new instance of the Point structure.

Declaration
public Point(int x, int y, bool round = false, int decimals = 0)
Parameters
Type Name Description
System.Int32 x

X axis coordinate.

System.Int32 y

Y axis coordinate.

System.Boolean round
System.Int32 decimals
View Source

Point(Int64, Int64, Boolean, Int32)

Initializes a new instance of the Point structure.

Declaration
public Point(long x, long y, bool round = false, int decimals = 0)
Parameters
Type Name Description
System.Int64 x

X axis coordinate.

System.Int64 y

Y axis coordinate.

System.Boolean round
System.Int32 decimals
View Source

Point(Single, Single, Boolean, Int32)

Initializes a new instance of the Point structure.

Declaration
public Point(float x, float y, bool round = false, int decimals = 0)
Parameters
Type Name Description
System.Single x

X axis coordinate.

System.Single y

Y axis coordinate.

System.Boolean round
System.Int32 decimals

Properties

View Source

X

X coordinate.

Declaration
public double X { get; }
Property Value
Type Description
System.Double
View Source

Y

Y coordinate.

Declaration
public double Y { get; }
Property Value
Type Description
System.Double

Methods

View Source

Add(Point, Point)

Addition operator - adds values of two points.

Declaration
public static Point Add(Point point1, Point point2)
Parameters
Type Name Description
Point point1

First point for addition.

Point point2

Second point for addition.

Returns
Type Description
Point

Returns new point which coordinates equal to sum of corresponding coordinates of specified points.

View Source

Add(Point, Double)

Addition operator - adds scalar to the specified point.

Declaration
public static Point Add(Point point, double valueToAdd)
Parameters
Type Name Description
Point point

Point to increase coordinates of.

System.Double valueToAdd

Value to add to coordinates of the specified point.

Returns
Type Description
Point

Returns new point which coordinates equal to coordinates of the specified point increased by specified value.

View Source

CompareTo(Point)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

Declaration
public int CompareTo(Point other)
Parameters
Type Name Description
Point other

An object to compare with this instance.

Returns
Type Description
System.Int32

A value that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance precedes other in the sort order. Zero This instance occurs in the same position in the sort order as other. Greater than zero This instance follows other in the sort order.

View Source

DistanceTo(Point)

Calculate Euclidean distance between two points.

Declaration
public double DistanceTo(Point anotherPoint)
Parameters
Type Name Description
Point anotherPoint

Point to calculate distance to.

Returns
Type Description
System.Double

Returns Euclidean distance between this point and anotherPoint points.

View Source

Divide(Point, Double)

Division operator - divides coordinates of the specified point by scalar value.

Declaration
public static Point Divide(Point point, double factor)
Parameters
Type Name Description
Point point

Point to divide coordinates of.

System.Double factor

Division factor.

Returns
Type Description
Point

Returns new point which coordinates equal to coordinates of the specified point divided by specified value.

View Source

Equals(Object)

Check if this instance of Point equal to the specified one.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

Another point to check equalty to.

Returns
Type Description
System.Boolean

Return true if objects are equal.

View Source

EuclideanNorm(Boolean, Int32)

Calculate Euclidean norm of the vector comprised of the point's coordinates - distance from (0, 0) in other words.

Declaration
public double EuclideanNorm(bool round = false, int decimals = 0)
Parameters
Type Name Description
System.Boolean round
System.Int32 decimals
Returns
Type Description
System.Double

Returns point's distance from (0, 0) point.

View Source

GetHashCode()

Get hash code for this instance.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

Returns the hash code for this instance.

View Source

Multiply(Point, Double)

Multiplication operator - multiplies coordinates of the specified point by scalar value.

Declaration
public static Point Multiply(Point point, double factor)
Parameters
Type Name Description
Point point

Point to multiply coordinates of.

System.Double factor

Multiplication factor.

Returns
Type Description
Point

Returns new point which coordinates equal to coordinates of the specified point multiplied by specified value.

View Source

SquaredDistanceTo(Point)

Calculate squared Euclidean distance between two points.

Declaration
public double SquaredDistanceTo(Point anotherPoint)
Parameters
Type Name Description
Point anotherPoint

Point to calculate distance to.

Returns
Type Description
System.Double

Returns squared Euclidean distance between this point and anotherPoint points.

View Source

Subtract(Point, Point)

Subtraction operator - subtracts values of two points.

Declaration
public static Point Subtract(Point point1, Point point2)
Parameters
Type Name Description
Point point1

Point to subtract from.

Point point2

Point to subtract.

Returns
Type Description
Point

Returns new point which coordinates equal to difference of corresponding coordinates of specified points.

View Source

Subtract(Point, Double)

Subtraction operator - subtracts scalar from the specified point.

Declaration
public static Point Subtract(Point point, double valueToSubtract)
Parameters
Type Name Description
Point point

Point to decrease coordinates of.

System.Double valueToSubtract

Value to subtract from coordinates of the specified point.

Returns
Type Description
Point

Returns new point which coordinates equal to coordinates of the specified point decreased by specified value.

View Source

ToString()

Get string representation of the class.

Declaration
public override string ToString()
Returns
Type Description
System.String

Returns string, which contains values of the point in readable form.

Operators

View Source

Addition(Point, Point)

Addition operator - adds values of two points.

Declaration
public static Point operator +(Point point1, Point point2)
Parameters
Type Name Description
Point point1

First point for addition.

Point point2

Second point for addition.

Returns
Type Description
Point

Returns new point which coordinates equal to sum of corresponding coordinates of specified points.

View Source

Addition(Point, Double)

Addition operator - adds scalar to the specified point.

Declaration
public static Point operator +(Point point, double valueToAdd)
Parameters
Type Name Description
Point point

Point to increase coordinates of.

System.Double valueToAdd

Value to add to coordinates of the specified point.

Returns
Type Description
Point

Returns new point which coordinates equal to coordinates of the specified point increased by specified value.

View Source

Division(Point, Double)

Division operator - divides coordinates of the specified point by scalar value.

Declaration
public static Point operator /(Point point, double factor)
Parameters
Type Name Description
Point point

Point to divide coordinates of.

System.Double factor

Division factor.

Returns
Type Description
Point

Returns new point which coordinates equal to coordinates of the specified point divided by specified value.

View Source

Equality(Point, Point)

Equality operator - checks if two points have equal coordinates.

Declaration
public static bool operator ==(Point point1, Point point2)
Parameters
Type Name Description
Point point1

First point to check.

Point point2

Second point to check.

Returns
Type Description
System.Boolean

Returns true if coordinates of specified points are equal.

View Source

Inequality(Point, Point)

Inequality operator - checks if two points have different coordinates.

Declaration
public static bool operator !=(Point point1, Point point2)
Parameters
Type Name Description
Point point1

First point to check.

Point point2

Second point to check.

Returns
Type Description
System.Boolean

Returns true if coordinates of specified points are not equal.

View Source

Multiply(Point, Double)

Multiplication operator - multiplies coordinates of the specified point by scalar value.

Declaration
public static Point operator *(Point point, double factor)
Parameters
Type Name Description
Point point

Point to multiply coordinates of.

System.Double factor

Multiplication factor.

Returns
Type Description
Point

Returns new point which coordinates equal to coordinates of the specified point multiplied by specified value.

View Source

Subtraction(Point, Point)

Subtraction operator - subtracts values of two points.

Declaration
public static Point operator -(Point point1, Point point2)
Parameters
Type Name Description
Point point1

Point to subtract from.

Point point2

Point to subtract.

Returns
Type Description
Point

Returns new point which coordinates equal to difference of corresponding coordinates of specified points.

View Source

Subtraction(Point, Double)

Subtraction operator - subtracts scalar from the specified point.

Declaration
public static Point operator -(Point point, double valueToSubtract)
Parameters
Type Name Description
Point point

Point to decrease coordinates of.

System.Double valueToSubtract

Value to subtract from coordinates of the specified point.

Returns
Type Description
Point

Returns new point which coordinates equal to coordinates of the specified point decreased by specified value.

Extension Methods

Matrix.Replace<T>(T, Object, Object)
Matrix.IsEqual(Object, Object, Decimal, Decimal)
EntityBaseExtensions.HasProperty(Object, String)
ArrayExtensions.Concatenate<T>(T, T[])
CollectionExtensions.FromHierarchy<TSource>(TSource, Func<TSource, TSource>, Func<TSource, Boolean>)
CollectionExtensions.FromHierarchy<TSource>(TSource, Func<TSource, TSource>)
ObjectExtensions.Clone<T>(T)
ObjectExtensions.To<T>(Object)
ObjectExtensions.To(Object, Type)
ObjectExtensions.HasMethod(Object, String)
ObjectExtensions.AddressOf<T>(T)
ReflectionExtensions.GetIdentityValue<T>(T)
ReflectionExtensions.GetIdentityValue<T, TResult>(T)
ReflectionExtensions.GetIdentityProperty<T>(T)
ReflectionExtensions.HasIdentityProperty<T>(T)
ReflectionExtensions.GetPropertyValue<T, TResult>(T, String, TResult)
ReflectionExtensions.GetPropertyInfo<T, TValue>(T, Expression<Func<T, TValue>>)
ReflectionExtensions.GetTitleValue<T>(T)
ReflectionExtensions.HasParentIdentityProperty<T>(T)
ReflectionExtensions.GetParentIdentityProperty<T>(T)
ReflectionExtensions.IsFreeApplication<T>(T)