import type { Attribs } from "@thi.ng/geom-api" ; import { circumCenter2 } from "@thi.ng/geom-poly-utils/circumcenter" ; import type { ReadonlyVec , Vec } from "@thi.ng/vectors" ; import { dist } from "@thi.ng/vectors/dist" ; import { mixN2 } from "@thi.ng/vectors/mixn" ; import { Circle } from "./api/circle.js" ; import { __argsVN } from "./internal/args.js" ; export function circle ( pos , r , attribs ? ) ; export function circle ( pos , attribs ? ) ; export function circle ( r , attribs ? ) ; export function circle ( attribs ? ) ; export function circle ( ... args ) { return new Circle ( ... __argsVN ( args ) ) ; } export const circleFrom2Points = ( a , b , attribs ? ) => new Circle ( mixN2 ( [ ] , a , b , 0.5 ) , dist ( a , b ) / 2 , attribs ) ; export const circleFrom3Points = ( a , b , c , attribs ? ) => { const o = circumCenter2 ( a , b , c ) ; return o ? new Circle ( o , dist ( a , o ) , attribs ) : undefined ; } ;