Point2f
References[StructLayout(LayoutKind.Sequential, Pack = 4, Size = 8)]
[DebuggerDisplay("({m_x}, {m_y})")]
[Serializable]
public struct Point2f : IEquatable<Point2f>, IComparable<Point2f>, IComparable, IEpsilonFComparable<Point2f>, IFormattable
Represents the two coordinates of a point in two-dimensional space, using float-precision floating point numbers.
Constructors
Initializes a new two-dimensional point from two double-precision floating point numbers as coordinates.
Coordinates will be internally converted to floating point numbers. This might cause precision loss.
Properties
Gets a value indicating whether this point is considered valid.
Indexers
Methods
DistanceTo
#Computes the distance between two points.
Parameters:
| other (Point2f) | Other point for distance measurement. |
Returns: The length of the line between this and the other point; or 0 if any of the points is not valid.
Computes the squared distance between two points.
Parameters:
| other (Point2f) | Other point for distance measurement. |
Returns: The squared length of the line between this and the other point; or 0 if any of the points is not valid.
Check that all values in other are within epsilon of the values in this
Implements: EpsilonEquals
Equals
#Determines whether the specified System.Object is a Point2f and has the same values as the present point.
Parameters:
| obj (object) | The specified object. |
Returns: true if obj is Point2f and has the same coordinates as this; otherwise false.
Overrides: ValueType.Equals
Determines whether the specified Point2f has the same values as the present point.
Parameters:
| point (Point2f) | The specified point. |
Returns: true if point has the same coordinates as this; otherwise false.
GetHashCode
#Computes a hash number that represents the current point.
Returns: A hash code that is not unique for each point.
Overrides: ValueType.GetHashCode
Parameters:
| obj (object) |
ToString
#Constructs the string representation for the current point.
Returns: The point representation in the form X,Y.
Overrides: ValueType.ToString
Formats the value of the current instance using the specified format.
Parameters:
| format (string) | The format to use. -or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the IFormattable implementation. |
| formatProvider (IFormatProvider) | The provider to use to format the value. -or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system. |
Returns: The value of the current instance in the specified format.
Operators
| Operation | Result | Description | ||
|---|---|---|---|---|
| Point2f | + | Point2f | Vector2f | Sums two Point2fs. |
| Point2f | / | float | Point2f | Divides a Point2f by a scalar. |
| Point2f | == | Point2f | bool | Determines whether two Point2f have equal values. |
| Point2f | > | Point2f | bool | Determines whether the first specified Point2f comes after (has superior sorting value than) the second point. Coordinates evaluation priority is first X, then Y. |
| Point2f | >= | Point2f | bool | Determines whether the first specified Point2f comes after (has superior sorting value than) the second point, or it is equal to it. Coordinates evaluation priority is first X, then Y. |
| Point2f | != | Point2f | bool | Determines whether two Point2f have different values. |
| Point2f | < | Point2f | bool | Determines whether the first specified Point2f comes before (has inferior sorting value than) the second point. Coordinates evaluation priority is first X, then Y. |
| Point2f | <= | Point2f | bool | Determines whether the first specified Point2f comes before (has inferior sorting value than) the second point, or it is equal to it. Coordinates evaluation priority is first X, then Y. |
| Point2f | * | float | Point2f | Multiplies a Point2f by a scalar. |
| Point2f | - | Point2f | Vector2f | Subtracts two Point2fs. |