import { Point } from "pixi.js" ; export class CircleUtils { param x param y param radius param startAngle param endRadian static getRadianPath ( x , y , radius , startAngle , endAngle ) { let startRadian = Math . PI * 2 * ( startAngle / 360 ) ; let endRadian = Math . PI * 2 * ( endAngle / 360 ) ; let radian = Math . PI - startRadian - endRadian ; let offsetX = radius * Math . sin ( radian ) ; let offsetY = radius * Math . cos ( radian ) ; return new Point ( x + offsetX , y + offsetY ) ; } param x param y param radius param density static getPath ( x , y , radius , density = 1 ) { let arr = new Array ( ) ; let count = 360 / density ; for ( var times = 0 ; times < count ; times ++ ) { var hudu = ( 2 * Math . PI / 360 ) * ( 360 / count ) * times ; var X = x + Math . sin ( hudu ) * radius ; var Y = y - Math . cos ( hudu ) * radius ; arr . push ( new Point ( X , Y ) ) ; } return arr ; } }