Options
All
  • Public
  • Public/Protected
  • All
Menu
classdesc

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

requires

SVGSerializable

requires

UID

requires

UIDGenerator

requires

Vertex

Hierarchy

  • VEllipse

Implements

Index

Constructors

constructor

  • The constructor.

    name

    VEllipse

    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

Properties

axis

axis: Vertex
member

{Vertex}

memberof

VEllipse

instance

center

center: Vertex
member

{Vertex}

memberof

VEllipse

instance

Readonly className

className: string = "VEllipse"

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

isDestroyed

isDestroyed: boolean
member

isDestroyed

memberof

VEllipse

instance

rotation

rotation: number
member

{number}

memberof

VEllipse

instance

Readonly uid

uid: UID

The UID of this drawable object.

member

{UID}

memberof

VEllipse

instance
readonly

Methods

clone

destroy

  • destroy(): void
  • 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

getEquidistantVertices

  • getEquidistantVertices(pointCount: number): Array<Vertex>
  • Get equally distributed points on the outline of this ellipse.

    Parameters

    • pointCount: number

      The number of points.

    Returns Array<Vertex>

getFoci

  • Get the two foci of this ellipse.

    method

    getFoci

    instance
    memberof

    VEllipse

    Returns [Vertex, Vertex]

    An array with two elements, the two focal points of the ellipse (foci).

normalAt

  • normalAt(angle: number, length?: number): Vector
  • 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.

    method

    normalAt

    instance
    memberof

    VEllipse

    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

perimeter

  • perimeter(): number
  • Get the perimeter of this ellipse.

    method

    perimeter

    instance
    memberof

    VEllipse

    Returns number

radiusH

  • radiusH(): number
  • Get the non-negative horizonal radius of this ellipse.

    method

    radiusH

    instance
    memberof

    VEllipse

    Returns number

    The unsigned horizontal radius of this ellipse.

radiusV

  • radiusV(): number
  • Get the non-negative vertical radius of this ellipse.

    method

    radiusV

    instance
    memberof

    VEllipse

    Returns number

    The unsigned vertical radius of this ellipse.

rotate

  • Rotate this ellipse around its center.

    method

    rotate

    instance
    memberof

    VEllipse

    Parameters

    • angle: number

      The angle to rotate by.

    Returns VEllipse

    this for chaining.

scale

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

    method

    scale

    instance
    memberof

    VEllipse

    Parameters

    • factor: number

      The factor to scale by.

    Returns VEllipse

    this for chaining.

signedRadiusH

  • signedRadiusH(): number
  • Get the signed horizonal radius of this ellipse.

    method

    signedRadiusH

    instance
    memberof

    VEllipse

    Returns number

    The signed horizontal radius of this ellipse.

signedRadiusV

  • signedRadiusV(): number
  • Get the signed vertical radius of this ellipse.

    method

    radiusV

    instance
    memberof

    VEllipse

    Returns number

    The signed vertical radius of this ellipse.

tangentAt

  • tangentAt(angle: number, length?: number): Vector
  • 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.

    method

    tangentAt

    instance
    memberof

    VEllipse

    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

toCubicBezier

  • toCubicBezier(quarterSegmentCount?: number, threshold?: number): Array<CubicBezierCurve>
  • 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 Array<CubicBezierCurve>

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

vertAt

  • vertAt(angle: number): Vertex
  • Get the vertex on the ellipse's outline at the given angle.

    method

    vertAt

    instance
    memberof

    VEllipse

    Parameters

    • angle: number

      The angle to determine the vertex at.

    Returns Vertex

    The vertex on the outline at the given angle.

Object literals

Static utils

utils: object

A static collection of ellipse-related helper functions.

static

equidistantVertAngles

  • equidistantVertAngles(radiusH: number, radiusV: number, pointCount: number): Array<number>
  • Get n equidistant points on the elliptic arc.

    Parameters

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

    Returns Array<number>

phiToTheta

  • phiToTheta(radiusH: number, radiusV: number, phi: number): number
  • Get the theta for a given phi (used to determine equidistant points on ellipse).

    Parameters

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

    Returns number

    theta

polarToCartesian

  • polarToCartesian(centerX: number, centerY: number, radiusH: number, radiusV: number, angle: number): XYCoords
  • Calculate a particular point on the outline of the given ellipse (center plus two radii plus angle).

    name

    polarToCartesian

    reutn

    {XYCoords} The outlont point in absolute x-y-coordinates.

    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

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Private property
  • Private method
  • Static property
  • Static method

Generated using TypeDoc