Defined in: geometry.ts:110
Axis-aligned ellipse.
contains includes boundary points. If either radius is not positive, all points are rejected.
Example
ts
const ellipse = new Ellipse(10, 20, 6, 4)
ellipse.contains({ x: 10, y: 20 }) // trueExtends
Shape<"ellipse">
Constructors
Constructor
new Ellipse(
cx,cy,rx,ry):Ellipse
Defined in: geometry.ts:113
Parameters
| Parameter | Type | Description |
|---|---|---|
cx | number | Center x coordinate. |
cy | number | Center y coordinate. |
rx | number | Horizontal radius. |
ry | number | Vertical radius. |
Returns
Ellipse
Overrides
Properties
| Property | Modifier | Type | Default value | Description | Overrides | Defined in |
|---|---|---|---|---|---|---|
cx | readonly | number | undefined | Center x coordinate. | - | geometry.ts:115 |
cy | readonly | number | undefined | Center y coordinate. | - | geometry.ts:117 |
rx | readonly | number | undefined | Horizontal radius. | - | geometry.ts:119 |
ry | readonly | number | undefined | Vertical radius. | - | geometry.ts:121 |
type | readonly | "ellipse" | 'ellipse' | - | Shape.type | geometry.ts:111 |
Methods
contains()
contains(
point):boolean
Defined in: geometry.ts:132
Checks whether a point is inside or on the ellipse boundary.
Parameters
| Parameter | Type | Description |
|---|---|---|
point | Point | Point to test. |
Returns
boolean
Whether the point is contained by the ellipse.
Overrides
svgPath()
svgPath():
string
Defined in: geometry.ts:146
Generates an SVG path string for the ellipse.
Returns
string
SVG path data.