Skip to content

Ellipse

An Ellipse draws an elliptical shape with independent X and Y radii, rotation, and optional start/end angles for partial ellipses.

Example

Usage

ts
import {
    createEllipse,
} from '@ripl/core';

const ellipse = createEllipse({
    fillStyle: '#3a86ff',
    cx: 200,
    cy: 150,
    radiusX: 100,
    radiusY: 60,
    rotation: 0,
    startAngle: 0,
    endAngle: Math.PI * 2,
});

Properties

PropertyTypeRequiredDescription
cxnumberYesCenter X coordinate
cynumberYesCenter Y coordinate
radiusXnumberYesHorizontal radius
radiusYnumberYesVertical radius
rotationnumberYesRotation angle in radians
startAnglenumberYesStart angle in radians
endAnglenumberYesEnd angle in radians

Plus all Element style properties and Shape options.