Triangle

public class Triangle: Polygon

Triangle defines a concrete subclass of Polygon whose shape is a closed triangle.

  • Initializes a new Triangle using the specified array of points.

    Protects against trying to create a triangle with less than three points.

    Declaration

    Swift

    public override init(_ points: [Point])

    Parameters

    points

    An array of Point structs.

  • Initializes a new Polygon from data in a given unarchiver. - parameter coder: An unarchiver object.

    Declaration

    Swift

    required public init(coder: NSCoder)

    Parameters

    coder

    An unarchiver object.