calculateOffset method
计算椭圆轨迹的点
Implementation
Offset calculateOffset(double angle) {
double width = widgetWidth * 0.7; //椭圆宽
double radiusOuterX = width / 2;
double radiusOuterY = ellipseHeight;
double angleOuter = (2 * pi / 360) * angle;
double x = radiusOuterX * sin(angleOuter);
double y = radiusOuterY > 0 ? radiusOuterY * cos(angleOuter) : 0;
return Offset(x + (widgetWidth - itemConfig.width) / 2, -y);
}