Point

public struct Point
extension Point: Equatable

A structure that contains a point in a two-dimensional coordinate system.

  • x

    The x-coordinate of the point.

    Declaration

    Swift

    public var x: Int
  • y

    The y-coordinate of the point.

    Declaration

    Swift

    public var y: Int
  • Creates a point with specified coordinates.

    Declaration

    Swift

    public init(x: Int, y: Int)

    Parameters

    x

    The x-coordinate of the point

    y

    The y-coordinate of the point

Hexadecimal

  • The point at the origin (0,0).

    Declaration

    Swift

    public static let zero: Point
  • Creates a point with specified coordinates.

    Declaration

    Swift

    public init(x: Int32, y: Int32)

    Parameters

    x

    The x-coordinate of the point

    y

    The y-coordinate of the point

  • Returns a Boolean value indicating whether two values are equal.

    Equality is the inverse of inequality. For any values a and b, a == b implies that a != b is false.

    Declaration

    Swift

    public static func == (lhs: Point, rhs: Point) -> Bool

    Parameters

    lhs

    A value to compare.

    rhs

    Another value to compare.