Show / Hide Table of Contents

Struct Point

Universal type for a set of two-dimensional coordinates.

Implements
IVector
IEquatable<IVector>
IEquatable<Vector2>
IFormattable
IEquatable<Point>
Inherited Members
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: TheXDS.MCART.Types
Assembly: MCART.dll
Syntax
public struct Point : IVector, IEquatable<IVector>, IEquatable<Vector2>, IFormattable, IEquatable<Point>

Constructors

| Edit this page View Source

Point()

Initializes a new instance of the Point structure.

Declaration
public Point()
| Edit this page View Source

Point(double, double)

Universal type for a set of two-dimensional coordinates.

Declaration
public Point(double x, double y)
Parameters
Type Name Description
double x

The x coordinate.

double y

The y coordinate.

Fields

| Edit this page View Source

Nowhere

Gets a point that does not represent any position. This field is read-only.

Declaration
public static readonly Point Nowhere
Field Value
Type Description
Point

A Point with its coordinates set to NaN.

| Edit this page View Source

Origin

Gets a point at the origin. This field is read-only.

Declaration
public static readonly Point Origin
Field Value
Type Description
Point

A Point with its coordinates at the origin.

Properties

| Edit this page View Source

X

Coordenada X.

Declaration
public double X { readonly get; set; }
Property Value
Type Description
double
| Edit this page View Source

Y

Coordenada Y.

Declaration
public double Y { readonly get; set; }
Property Value
Type Description
double

Methods

| Edit this page View Source

Angle()

Calcula el ángulo formado por la línea que intersecta el origen y este Point contra el eje horizontal X.

Declaration
public readonly double Angle()
Returns
Type Description
double

El ángulo calculado.

| Edit this page View Source

Equals(object?)

Indica si esta instancia y un objeto especificado son iguales.

Declaration
public override readonly bool Equals(object? obj)
Parameters
Type Name Description
object obj

Objeto que se va a compara con la instancia actual.

Returns
Type Description
bool

true si esta instancia y obj son iguales, false en caso contrario.

Overrides
ValueType.Equals(object)
| Edit this page View Source

Equals(IVector?)

Compara la igualdad de los vectores.

Declaration
public readonly bool Equals(IVector? other)
Parameters
Type Name Description
IVector other

IVector contra el cual comparar.

Returns
Type Description
bool

true si todos los vectores de ambos objetos son iguales, false en caso contrario.

| Edit this page View Source

Equals(Point)

Compara la igualdad de los vectores de los puntos.

Declaration
public readonly bool Equals(Point other)
Parameters
Type Name Description
Point other

Point contra el cual comparar.

Returns
Type Description
bool

true si todos los vectores de ambos puntos son iguales; de lo contrario, false.

| Edit this page View Source

GetHashCode()

Devuelve el código Hash de esta instancia.

Declaration
public override readonly int GetHashCode()
Returns
Type Description
int

El código Hash de esta instancia.

Overrides
ValueType.GetHashCode()
| Edit this page View Source

Magnitude()

Calcula la magnitud de las coordenadas.

Declaration
public readonly double Magnitude()
Returns
Type Description
double

La magnitud resultante entre el punto y el origen.

| Edit this page View Source

Magnitude(double, double)

Calcula la magnitud de las coordenadas desde el punto especificado.

Declaration
public readonly double Magnitude(double fromX, double fromY)
Parameters
Type Name Description
double fromX

Coordenada X de origen.

double fromY

Coordenada Y de origen.

Returns
Type Description
double

La magnitud resultante entre el punto y las coordenadas especificadas.

| Edit this page View Source

Magnitude(Point)

Calcula la magnitud de las coordenadas desde el punto especificado.

Declaration
public readonly double Magnitude(Point fromPoint)
Parameters
Type Name Description
Point fromPoint

Punto de referencia para calcular la magnitud.

Returns
Type Description
double

La magnitud resultante entre ambos puntos.

| Edit this page View Source

Parse(string)

Crea un Point a partir de una cadena.

Declaration
public static Point Parse(string value)
Parameters
Type Name Description
string value

Valor a partir del cual crear un Point.

Returns
Type Description
Point

Point que ha sido creado.

Exceptions
Type Condition
FormatException

Se produce si la conversión ha fallado.

| Edit this page View Source

ToString()

Convierte este objeto en su representación como una cadena.

Declaration
public override readonly string ToString()
Returns
Type Description
string

Una representación en forma de string de este objeto.

Overrides
ValueType.ToString()
| Edit this page View Source

ToString(string?)

Convierte este objeto en su representación como una cadena.

Declaration
public readonly string ToString(string? format)
Parameters
Type Name Description
string format

Formato a utilizar.

Returns
Type Description
string

Una representación en forma de string de este objeto.

| Edit this page View Source

ToString(string?, IFormatProvider?)

Convierte este objeto en su representación como una cadena.

Declaration
public readonly string ToString(string? format, IFormatProvider? formatProvider)
Parameters
Type Name Description
string format

Formato a utilizar.

IFormatProvider formatProvider

Parámetro opcional. Proveedor de formato de la cultura a utilizar para dar formato a la representación como una cadena de este objeto. Si se omite, se utilizará CurrentCulture.

Returns
Type Description
string

Una representación en forma de string de este objeto.

| Edit this page View Source

TryParse(string, out Point)

Intenta crear un Point a partir de una cadena.

Declaration
public static bool TryParse(string value, out Point point)
Parameters
Type Name Description
string value

Valor a partir del cual crear un Point.

Point point

Point que ha sido creado.

Returns
Type Description
bool

true si la conversión ha tenido éxito, false en caso contrario.

| Edit this page View Source

WithinBox(in double, in double, in double, in double)

Determina si el punto se encuentra dentro del rectángulo formado por las coordenadas especificadas.

Declaration
public readonly bool WithinBox(in double x1, in double y1, in double x2, in double y2)
Parameters
Type Name Description
double x1

La primer coordenada x.

double y1

La primer coordenada y.

double x2

La segunda coordenada x.

double y2

La segunda coordenada y.

Returns
Type Description
bool

true si el punto se encuentra dentro del rectángulo formado, false en caso contrario.

| Edit this page View Source

WithinBox(in Point, in Point)

Determina si el punto se encuentra dentro del rectángulo formado por los puntos especificados.

Declaration
public readonly bool WithinBox(in Point p1, in Point p2)
Parameters
Type Name Description
Point p1

Punto 1.

Point p2

Punto 2.

Returns
Type Description
bool

true si el punto se encuentra dentro del rectángulo formado, false en caso contrario.

| Edit this page View Source

WithinBox(in Range<double>, in Range<double>)

Determina si el punto se encuentra dentro del rectángulo formado por los rangos especificados.

Declaration
public readonly bool WithinBox(in Range<double> x, in Range<double> y)
Parameters
Type Name Description
Range<double> x

Rango de valores para el eje X.

Range<double> y

Rango de valores para el eje Y.

Returns
Type Description
bool

true si el punto se encuentra dentro del rectángulo formado, false en caso contrario.

| Edit this page View Source

WithinBox(in Size)

Determina si el punto se encuentra dentro del rectángulo formado por las coordenadas especificadas.

Declaration
public readonly bool WithinBox(in Size size)
Parameters
Type Name Description
Size size

Tamaño del rectángulo.

Returns
Type Description
bool

true si el punto se encuentra dentro del rectángulo formado, false en caso contrario.

| Edit this page View Source

WithinBox(in Size, in Point)

Determina si el punto se encuentra dentro del rectángulo formado por las coordenadas especificadas.

Declaration
public readonly bool WithinBox(in Size size, in Point topLeft)
Parameters
Type Name Description
Size size

Tamaño del rectángulo.

Point topLeft

Coordenadas de esquina superior izquierda

Returns
Type Description
bool

true si el punto se encuentra dentro del rectángulo formado, false en caso contrario.

| Edit this page View Source

WithinCircle(in Point, in double)

Determina si el punto se encuentra dentro del círculo especificado.

Declaration
public readonly bool WithinCircle(in Point center, in double radius)
Parameters
Type Name Description
Point center

Punto central del círculo.

double radius

Radio del círculo.

Returns
Type Description
bool

true si el punto se encuentra dentro del círculo, false en caso contrario.

Operators

| Edit this page View Source

operator +(Point, double)

Performs addition on a point.

Declaration
public static Point operator +(Point l, double r)
Parameters
Type Name Description
Point l

Point 1.

double r

Addition operand.

Returns
Type Description
Point

A new Point whose vectors are the sum of the original vectors + r.

| Edit this page View Source

operator +(Point, IVector)

Performs addition on points.

Declaration
public static Point operator +(Point l, IVector r)
Parameters
Type Name Description
Point l

Point 1.

IVector r

Point 2.

Returns
Type Description
Point

The sum of the vectors of the points.

| Edit this page View Source

operator +(Point, Point)

Performs addition on points.

Declaration
public static Point operator +(Point l, Point r)
Parameters
Type Name Description
Point l

Point 1.

Point r

Point 2.

Returns
Type Description
Point

The sum of the vectors of the points.

| Edit this page View Source

operator --(Point)

Decrementa en 1 los vectores del punto.

Declaration
public static Point operator --(Point p)
Parameters
Type Name Description
Point p

Punto a decrementar.

Returns
Type Description
Point

Un punto con sus vectores decrementados en 1.

| Edit this page View Source

operator /(Point, double)

Realiza una operación de división sobre el punto.

Declaration
public static Point operator /(Point l, double r)
Parameters
Type Name Description
Point l

Punto 1.

double r

Operando de división.

Returns
Type Description
Point

Un nuevo Point cuyos vectores son la división de los vectores originales / r.

| Edit this page View Source

operator /(Point, IVector)

Realiza una operación de división sobre los puntos.

Declaration
public static Point operator /(Point l, IVector r)
Parameters
Type Name Description
Point l

Punto 1.

IVector r

Punto 2.

Returns
Type Description
Point

La división de los vectores de los puntos.

| Edit this page View Source

operator /(Point, Point)

Realiza una operación de división sobre los puntos.

Declaration
public static Point operator /(Point l, Point r)
Parameters
Type Name Description
Point l

Punto 1.

Point r

Punto 2.

Returns
Type Description
Point

La división de los vectores de los puntos.

| Edit this page View Source

operator ==(Point, IVector)

Compara la igualdad de los vectores de los puntos.

Declaration
public static bool operator ==(Point l, IVector r)
Parameters
Type Name Description
Point l

Punto a comparar.

IVector r

Vector bidimensional contra el cual comparar.

Returns
Type Description
bool

true si todos los vectores de ambos puntos son iguales; de lo contrario, false.

| Edit this page View Source

operator ==(Point, Point)

Compara la igualdad de los vectores de los puntos.

Declaration
public static bool operator ==(Point l, Point r)
Parameters
Type Name Description
Point l

Objeto a comparar

Point r

Objeto contra el cual comparar.

Returns
Type Description
bool

true si ambas instancias son iguales, false en caso contrario.

| Edit this page View Source

implicit operator Point(Point)

Converts a Point to a Point.

Declaration
public static implicit operator Point(Point x)
Parameters
Type Name Description
Point x

The Point to convert.

Returns
Type Description
Point

A Point equivalent to the specified Point.

| Edit this page View Source

implicit operator Point(Vector2)

Implicitly converts a Vector2 to a Point.

Declaration
public static implicit operator Point(Vector2 p)
Parameters
Type Name Description
Vector2 p

Vector2 value to be converted.

Returns
Type Description
Point
| Edit this page View Source

implicit operator Point(Point)

Converts a Point to a Point.

Declaration
public static implicit operator Point(Point x)
Parameters
Type Name Description
Point x

The Point to convert.

Returns
Type Description
Point

A Point equivalent to the specified Point.

| Edit this page View Source

implicit operator Vector2(Point)

Implicitly converts a Point to a Vector2.

Declaration
public static implicit operator Vector2(Point p)
Parameters
Type Name Description
Point p

Point value to be converted.

Returns
Type Description
Vector2
| Edit this page View Source

operator ++(Point)

Incrementa en 1 los vectores del punto.

Declaration
public static Point operator ++(Point p)
Parameters
Type Name Description
Point p

Punto a incrementar.

Returns
Type Description
Point

Un punto con sus vectores incrementados en 1.

| Edit this page View Source

operator !=(Point, IVector)

Compara la diferencia de los vectores de los puntos.

Declaration
public static bool operator !=(Point l, IVector r)
Parameters
Type Name Description
Point l

Punto a comparar.

IVector r

Vector bidimensional contra el cual comparar.

Returns
Type Description
bool

true si los vectores de ambos puntos son diferentes; de lo contrario, false.

| Edit this page View Source

operator !=(Point, Point)

Compara la diferencia de los vectores de los puntos.

Declaration
public static bool operator !=(Point l, Point r)
Parameters
Type Name Description
Point l

Punto 1.

Point r

Punto 2.

Returns
Type Description
bool

true si los vectores de ambos puntos son diferentes; de lo contrario, false.

| Edit this page View Source

operator %(Point, double)

Realiza una operación de residuo sobre el punto.

Declaration
public static Point operator %(Point l, double r)
Parameters
Type Name Description
Point l

Punto 1.

double r

Operando de residuo.

Returns
Type Description
Point

Un nuevo Point cuyos vectores son el residuo de los vectores originales % r.

| Edit this page View Source

operator %(Point, IVector)

Realiza una operación de residuo sobre los puntos.

Declaration
public static Point operator %(Point l, IVector r)
Parameters
Type Name Description
Point l

Punto 1.

IVector r

Punto 2.

Returns
Type Description
Point

El residuo de los vectores de los puntos.

| Edit this page View Source

operator %(Point, Point)

Realiza una operación de residuo sobre los puntos.

Declaration
public static Point operator %(Point l, Point r)
Parameters
Type Name Description
Point l

Punto 1.

Point r

Punto 2.

Returns
Type Description
Point

El residuo de los vectores de los puntos.

| Edit this page View Source

operator *(Point, double)

Realiza una operación de multiplicación sobre el punto.

Declaration
public static Point operator *(Point l, double r)
Parameters
Type Name Description
Point l

Punto 1.

double r

Operando de multiplicación.

Returns
Type Description
Point

Un nuevo Point cuyos vectores son la multiplicación de los vectores originales * r.

| Edit this page View Source

operator *(Point, IVector)

Realiza una operación de multiplicación sobre los puntos.

Declaration
public static Point operator *(Point l, IVector r)
Parameters
Type Name Description
Point l

Punto 1.

IVector r

Punto 2.

Returns
Type Description
Point

La multiplicación de los vectores de los puntos.

| Edit this page View Source

operator *(Point, Point)

Realiza una operación de multiplicación sobre los puntos.

Declaration
public static Point operator *(Point l, Point r)
Parameters
Type Name Description
Point l

Punto 1.

Point r

Punto 2.

Returns
Type Description
Point

La multiplicación de los vectores de los puntos.

| Edit this page View Source

operator -(Point, double)

Realiza una operación de resta sobre el punto.

Declaration
public static Point operator -(Point l, double r)
Parameters
Type Name Description
Point l

Punto 1.

double r

Operando de resta.

Returns
Type Description
Point

Un nuevo Point cuyos vectores son la resta de los vectores originales - r.

| Edit this page View Source

operator -(Point, IVector)

Performs subtraction on points.

Declaration
public static Point operator -(Point l, IVector r)
Parameters
Type Name Description
Point l

Point 1.

IVector r

Point 2.

Returns
Type Description
Point

The difference of the vectors of the points.

| Edit this page View Source

operator -(Point, Point)

Performs subtraction on points.

Declaration
public static Point operator -(Point l, Point r)
Parameters
Type Name Description
Point l

Point 1.

Point r

Point 2.

Returns
Type Description
Point

The difference of the vectors of the points.

| Edit this page View Source

operator -(Point)

Invierte el signo de los vectores del punto.

Declaration
public static Point operator -(Point p)
Parameters
Type Name Description
Point p

Punto a operar.

Returns
Type Description
Point

Un punto con el signo de sus vectores invertido.

| Edit this page View Source

operator +(Point)

Convierte a positivos los vectores del punto.

Declaration
public static Point operator +(Point p)
Parameters
Type Name Description
Point p

Punto a operar.

Returns
Type Description
Point

Un punto con sus vectores positivos.

Implements

IVector
IEquatable<T>
IEquatable<T>
IFormattable
IEquatable<T>

Extension Methods

Objects.ShallowCopyTo(object, object, Type)
ObjectExtensions.FieldsOf<T>(object)
ObjectExtensions.GetAttribute<T>(object)
ObjectExtensions.GetAttributes<T>(object)
ObjectExtensions.HasAttrValue<TAttribute, TValue>(object, out TValue)
ObjectExtensions.HasAttribute<T>(object)
ObjectExtensions.HasAttribute<T>(object, out T?)
ObjectExtensions.HasAttributes<T>(object, out IEnumerable<T>?)
ObjectExtensions.Is(object?, object?)
ObjectExtensions.IsEither(object, IEnumerable)
ObjectExtensions.IsEither(object, params object[])
ObjectExtensions.IsNeither(object, IEnumerable)
ObjectExtensions.IsNeither(object, params object[])
ObjectExtensions.IsNot(object?, object?)
ObjectExtensions.PropertiesOf<T>(object)
ObjectExtensions.WhichAre(object, IEnumerable<object>)
ObjectExtensions.WhichAre(object, params object[])
Objects.Itself<T>(T)
Objects.ShallowClone<T>(T)
Objects.ShallowCopyTo<T>(T, T)
CollectionExtensions.PushInto<TItem, TCollection>(TItem, ICollection<TCollection>)
DictionaryExtensions.PushInto<TKey, TValue>(TValue, TKey, IDictionary<TKey, TValue>)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX