Array

extension Array
extension Array where Element: Ray
extension Array where Element: Shape
extension Array where Element: Vector
extension Array where Element == Bool
  • Returns the arrays elements in paired tuples

    let a = ["zero", "one", "two", "three", "four"]
    let p = array.paired() // [("zero", "one"), ("one", "two"), ("two", "three"), ("three", "four")]
    

    Declaration

    Swift

    public func paired() -> [(Element, Element)]

Available where Element: Ray

  • A convenience method to draw an array of Rays

    Declaration

    Swift

    public func draw()

Available where Element: Shape

  • A convenience method to draw an array of Shapes

    Declaration

    Swift

    public func draw()

Available where Element: Vector

  • Randomly shift the position of points along a line extending from the given origin and the point

    Declaration

    Swift

    public func randomizePoints(origin: Vector, range: Range<Double> = -60..<60) -> [Vector]

    Parameters

    origin

    Origin to shift along

    range

    Range within to shift

Available where Element == Bool

  • Returns a boolean indicating whether all elements of the array are true

    Declaration

    Swift

    public func allTrue() -> Bool
  • Returns a boolean indicating whether all elements of the array are false

    Declaration

    Swift

    public func allFalse() -> Bool