import { isNumber } from "@thi.ng/checks/is-number" ; import type { Attribs , IHiccupShape } from "@thi.ng/geom-api" ; import type { Vec } from "@thi.ng/vectors" ; import { set } from "@thi.ng/vectors/set" ; import { __copyAttribs } from "../internal/copy.js" ; export class Ellipse implements IHiccupShape { r : Vec ; constructor ( public pos = [ 0 , 0 ] , r = [ 1 , 1 ] , public attribs ? ) { this . r = isNumber ( r ) ? [ r , r ] : r ; } get type ( ) { return "ellipse" ; } copy ( ) { return new Ellipse ( set ( [ ] , this . pos ) , set ( [ ] , this . r ) , __copyAttribs ( this ) ) ; } toHiccup ( ) { return [ "ellipse" , this . attribs , this . pos , this . r ] ; } }