Segment

public struct Segment

Model of line segment.

Type Properties

  • Undocumented

    Declaration

    Swift

    public static func horizontal(at y: Double) -> Segment
  • Undocumented

    Declaration

    Swift

    public static func vertical(at x: Double) -> Segment

Instance Properties

  • Vector of Line.

    Declaration

    Swift

    public var vector: Vector2 { get }
  • Length of Line.

    Declaration

    Swift

    public var length: Double { get }
  • Slope.

    Declaration

    Swift

    public var slope: Double { get }
  • Start point.

    Declaration

    Swift

    public let start: Point
  • end

    End point.

    Declaration

    Swift

    public let end: Point

Initializers

Instance Methods

  • Declaration

    Swift

    public func y(x: Double) -> Double?

    Return Value

    Vertical position for the given horizontal position, if it exists. Otherwise, nil.

  • Declaration

    Swift

    public func x(y: Double) -> Double?

    Return Value

    Horizontal position for the given vertical position, if it exists. Otherwise, nil.