Classdesc

A simple circle sector: circle, start- and end-angle.

Requires

Line

Requires

SVGSerializale

Requires

UID

Requires

UIDGenerator

Requires

XYCoords

Implements

Constructors

  • Create a new circle sector with given circle, start- and end-angle.

    Parameters

    • circle: Circle

      The circle.

    • startAngle: number

      The start angle of the sector.

    • endAngle: number

      The end angle of the sector.

    Returns CircleSector

    Name

    CircleSector

Properties

circle: Circle

Member

Memberof

CircleSector

Instance

className: string = "CircleSector"

Required to generate proper CSS classes and other class related IDs.

endAngle: number

Member

Memberof

CircleSector

Instance

isDestroyed: boolean

Member

isDestroyed

Memberof

CircleSector

Instance

startAngle: number

Member

Memberof

CircleSector

Instance

uid: string

The UID of this drawable object.

Member

Memberof

CircleSector

Instance

circleSectorUtils: {
    describeSVGArc: ((x, y, radius, startAngle, endAngle, options?) => SVGPathParams);
    polarToCartesian: ((centerX, centerY, radius, angle) => XYCoords);
} = ...

Type declaration

  • describeSVGArc: ((x, y, radius, startAngle, endAngle, options?) => SVGPathParams)

    Helper function to convert a circle section as SVG arc params (for the d attribute). Found at: https://stackoverflow.com/questions/5736398/how-to-calculate-the-svg-path-for-an-arc-of-a-circle

    TODO: generalize for ellipses (two radii).

    Returns

    [ 'A', radiusx, radiusy, rotation=0, largeArcFlag=1|0, sweepFlag=0, endx, endy ]

      • (x, y, radius, startAngle, endAngle, options?): SVGPathParams
      • Parameters

        • x: number
        • y: number
        • radius: number
        • startAngle: number
        • endAngle: number
        • Optional options: {
              moveToStart: boolean;
          }
          • moveToStart: boolean

            If false (default=true) the initial 'Move' command will not be used.

        Returns SVGPathParams

  • polarToCartesian: ((centerX, centerY, radius, angle) => XYCoords)

    Helper function to convert polar circle coordinates to cartesian coordinates.

    TODO: generalize for ellipses (two radii).

      • (centerX, centerY, radius, angle): XYCoords
      • Parameters

        • centerX: number
        • centerY: number
        • radius: number
        • angle: number

          The angle in radians.

        Returns XYCoords

Methods

  • Get the angle inside this sector for a given ratio. 0.0 means startAngle, and 1.0 means endAngle.

    Parameters

    • t: number

      The ratio inside [0..1].

    Returns number

    The angle inside this sector at a given ratio.

    Method

    angleAt

    Instance

    Memberof

    CircleSector

  • Calculate the intersection of this circle sector and some other sector.

    If the two sectors do not corerently intersect (when not both points of the radical line are containted in both source sectors) then null is returned.

    See demo/53-circle-sector-intersections for a geometric visualisation.

    Parameters

    Returns CircleSector

    The intersecion of both sectors or null if they don't intersect.

    Method

    circleSectorIntersection

    Instance

    Memberof

    CircleSector

  • Checks wether the given angle (must be inside 0 and PI*2) is contained inside this sector.

    Parameters

    • angle: number

      The numeric angle to check.

    Returns boolean

    True if (and only if) this sector contains the given angle.

    Method

    containsAngle

    Instance

    Memberof

    CircleSector

  • This function should invalidate any installed listeners and invalidate this object. After calling this function the object might not hold valid data any more and should not be used.

    Returns void

    Method

    destroy

    Instance

    Memberof

    CircleSector

  • Get the sectors ending point (on the underlying circle, located at the end angle).

    Returns Vertex

    The sector's ending point.

    Method

    getEndPoint

    Instance

    Memberof

    CircleSector

  • Get the sectors starting point (on the underlying circle, located at the start angle).

    Returns Vertex

    The sector's stating point.

    Method

    getStartPoint

    Instance

    Memberof

    CircleSector

Generated using TypeDoc