Skip to main content

Point Struct

Definition

Namespace:Avalonia
Assembly:Avalonia.Base
Package:Avalonia
Source:Point.cs

Defines a point.

public struct Point

Inheritance: ValueType -> Point

Implements: IEquatable<Point>

Constructors

NameDescription
PointInitializes a new instance of the Avalonia.Point structure.

Point Constructor

Initializes a new instance of the Avalonia.Point structure.

public Point(double x, double y)

Parameters

x double

The X position.

y double

The Y position.

Methods

NameDescription
DeconstructNo summary available.
DistanceComputes the Euclidean distance between the two given points.
Equals (2 overloads)Returns a boolean indicating whether the point is equal to the other given point (bitwise).
GetHashCodeReturns a hash code for a Avalonia.Point.
NearlyEqualsReturns a boolean indicating whether the point is equal to the other given point (numerically).
ParseParses a Avalonia.Point string.
ToStringReturns the string representation of the point.
TransformTransforms the point by a matrix.
WithXReturns a new point with the specified X coordinate.
WithYReturns a new point with the specified Y coordinate.

Deconstruct Method

public void Deconstruct(double& x, double& y)

Parameters

x double&

y double&

Distance Method

Computes the Euclidean distance between the two given points.

public double Distance(Avalonia.Point value1, Avalonia.Point value2)

Parameters

value1 Avalonia.Point

The first point.

value2 Avalonia.Point

The second point.

Returns

double

The Euclidean distance.

Equals overloads

Equals Method

Returns a boolean indicating whether the point is equal to the other given point (bitwise).

public bool Equals(Avalonia.Point other)
Parameters

other Avalonia.Point

The other point to test equality against.

Returns

bool

True if this point is equal to other; False otherwise.

Equals Method

Checks for equality between a point and an object.

public bool Equals(object obj)
Parameters

obj object

The object.

Returns

bool

True if obj is a point that equals the current point.

GetHashCode Method

Returns a hash code for a Avalonia.Point.

public int GetHashCode()

Returns

int

The hash code.

NearlyEquals Method

Returns a boolean indicating whether the point is equal to the other given point (numerically).

public bool NearlyEquals(Avalonia.Point other)

Parameters

other Avalonia.Point

The other point to test equality against.

Returns

bool

True if this point is equal to other; False otherwise.

Parse Method

Parses a Avalonia.Point string.

public Avalonia.Point Parse(string s)

Parameters

s string

The string.

Returns

Avalonia.Point

The Avalonia.Point.

ToString Method

Returns the string representation of the point.

public string ToString()

Returns

string

The string representation of the point.

Transform Method

Transforms the point by a matrix.

public Avalonia.Point Transform(Avalonia.Matrix transform)

Parameters

transform Avalonia.Matrix

The transform.

Returns

Avalonia.Point

The transformed point.

WithX Method

Returns a new point with the specified X coordinate.

public Avalonia.Point WithX(double x)

Parameters

x double

The X coordinate.

Returns

Avalonia.Point

The new point.

WithY Method

Returns a new point with the specified Y coordinate.

public Avalonia.Point WithY(double y)

Parameters

y double

The Y coordinate.

Returns

Avalonia.Point

The new point.

Properties

NameDescription
XGets the X position.
YGets the Y position.

X Property

Gets the X position.

public double X { get; set; }

Y Property

Gets the Y position.

public double Y { get; set; }