Classdesc

An ellipse class based on two vertices [centerX,centerY] and [radiusX,radiusY].

Requires

SVGSerializable

Requires

UID

Requires

UIDGenerator

Requires

Vertex

Implements

Constructors

  • The constructor.

    Parameters

    • center: Vertex

      The ellipses center.

    • axis: Vertex

      The x- and y-axis (the two radii encoded in a control point).

    • Optional rotation: number

      [optional, default=0] The rotation of this ellipse.

    Returns VEllipse

    Name

    VEllipse

Properties

axis: Vertex

Member

Memberof

VEllipse

Instance

center: Vertex

Member

Memberof

VEllipse

Instance

className: string = "VEllipse"

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

isDestroyed: boolean

Member

isDestroyed

Memberof

VEllipse

Instance

rotation: number

Member

Memberof

VEllipse

Instance

uid: string

The UID of this drawable object.

Member

Memberof

VEllipse

Instance

utils: {
    equidistantVertAngles: ((radiusH, radiusV, pointCount) => number[]);
    phiToTheta: ((radiusH, radiusV, phi) => number);
    polarToCartesian: ((centerX, centerY, radiusH, radiusV, angle) => XYCoords);
} = ...

A static collection of ellipse-related helper functions.

Type declaration

  • equidistantVertAngles: ((radiusH, radiusV, pointCount) => number[])

    Get n equidistant points on the elliptic arc.

    Returns

      • (radiusH, radiusV, pointCount): number[]
      • Parameters

        • radiusH: number
        • radiusV: number
        • pointCount: number

        Returns number[]

  • phiToTheta: ((radiusH, radiusV, phi) => number)

    Get the theta for a given phi (used to determine equidistant points on ellipse).

    Returns

    theta

      • (radiusH, radiusV, phi): number
      • Parameters

        • radiusH: number
        • radiusV: number
        • phi: number

        Returns number

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

    Calculate a particular point on the outline of the given ellipse (center plus two radii plus angle).

    Name

    polarToCartesian

    Reutn

    The outlont point in absolute x-y-coordinates.

      • (centerX, centerY, radiusH, radiusV, angle): XYCoords
      • Parameters

        • centerX: number

          The x coordinate of the elliptic center.

        • centerY: number

          The y coordinate of the elliptic center.

        • radiusH: number

          The horizontal radius of the ellipse.

        • radiusV: number

          The vertical radius of the ellipse.

        • angle: number

          The angle (in radians) to get the desired outline point for.

        Returns XYCoords

Static

Methods

  • 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

  • Get equally distributed points on the outline of this ellipse.

    Parameters

    • pointCount: number

      The number of points.

    Returns Vertex[]

  • Get the normal vector at the given angle. The normal vector is the vector that intersects the ellipse in a 90 degree angle at the given point (speicified by the given angle).

    Length of desired normal vector can be specified, default is 1.0.

    Parameters

    • angle: number

      The angle to get the normal vector at.

    • Optional length: number

      [optional, default=1] The length of the returned vector.

    Returns Vector

    Method

    normalAt

    Instance

    Memberof

    VEllipse

  • Get the perimeter of this ellipse.

    Returns number

    Method

    perimeter

    Instance

    Memberof

    VEllipse

  • Get the non-negative horizonal radius of this ellipse.

    Returns number

    The unsigned horizontal radius of this ellipse.

    Method

    radiusH

    Instance

    Memberof

    VEllipse

  • Get the non-negative vertical radius of this ellipse.

    Returns number

    The unsigned vertical radius of this ellipse.

    Method

    radiusV

    Instance

    Memberof

    VEllipse

  • Rotate this ellipse around its center.

    Parameters

    • angle: number

      The angle to rotate by.

    Returns VEllipse

    this for chaining.

    Method

    rotate

    Instance

    Memberof

    VEllipse

  • Scale this ellipse by the given factor from the center point. The factor will be applied to both radii.

    Parameters

    • factor: number

      The factor to scale by.

    Returns VEllipse

    this for chaining.

    Method

    scale

    Instance

    Memberof

    VEllipse

  • Get the signed horizonal radius of this ellipse.

    Returns number

    The signed horizontal radius of this ellipse.

    Method

    signedRadiusH

    Instance

    Memberof

    VEllipse

  • Get the signed vertical radius of this ellipse.

    Returns number

    The signed vertical radius of this ellipse.

    Method

    radiusV

    Instance

    Memberof

    VEllipse

  • Get the tangent vector at the given angle. The tangent vector is the vector that touches the ellipse exactly at the given given point (speicified by the given angle).

    Note that the tangent is just 90 degree rotated normal vector.

    Length of desired tangent vector can be specified, default is 1.0.

    Parameters

    • angle: number

      The angle to get the tangent vector at.

    • Optional length: number

      [optional, default=1] The length of the returned vector.

    Returns Vector

    Method

    tangentAt

    Instance

    Memberof

    VEllipse

  • Convert this ellipse into cubic Bézier curves.

    Parameters

    • Optional quarterSegmentCount: number

      The number of segments per base elliptic quarter (default is 3, min is 1).

    • Optional threshold: number

      The Bézier threshold (default value 0.666666 approximates the ellipse with best results but you might wish to use other values)

    Returns CubicBezierCurve[]

    An array of cubic Bézier curves representing this ellipse.

  • Get the vertex on the ellipse's outline at the given angle.

    Parameters

    • angle: number

      The angle to determine the vertex at.

    Returns Vertex

    The vertex on the outline at the given angle.

    Method

    vertAt

    Instance

    Memberof

    VEllipse

Generated using TypeDoc