Wedge

public class Wedge: Shape

Wedge is a concrete subclass of Shape whose shape is a wedge with a rounded outer edge.

  • Initializes a new Wedge, with the wedge always taking the shortest distance between start and end.

    This shape differs from Arc in that is adds a point at the center of the circle on which the wedge exists.

    let w = Wedge(center: canvas.center, radius: 50, start: M_PI_4 * 3, end: M_PI_4)
    canvas.add(w)
    

    Declaration

    Swift

    convenience public init(center: Point, radius: Double, start: Double, end: Double)

    Parameters

    center

    The center of the wedge.

    radius

    The radius of the wedge.

    start

    The start angle of the wedge.

    end

    The end angle of the wedge.

  • Initializes a new Wedge, with the wedge always taking the shortest distance between start and end.

    This shape differs from Arc in that is adds a point at the center of the circle on which the wedge exists.

    let w = Wedge(center: canvas.center, radius: 50, start: M_PI_4 * 3, end: M_PI_4, clockwise: true)
    canvas.add(w)
    

    Declaration

    Swift

    public init(center: Point, radius: Double, start: Double, end: Double, clockwise: Bool)

    Parameters

    center

    The center of the wedge.

    radius

    The radius of the wedge.

    start

    The start angle of the wedge.

    end

    The end angle of the wedge.

    clockwise

    Whether or not to close the shape in a clockwise fashion.