我的幸运转盘无法控制中奖项,求老师解惑
/**
* 点击启动旋转
*/
public void luckyStart(int index){
//计算每一项的角度
float angle=360/mItemCount;
//计算每一项中奖范围
float from=270-(index+1)*angle;
float end=from+angle;
//设置停下来需要旋转的距离
float targetFrom=4*360+from;
float targetEnd=4*360+end;
float v1=(float) ((-1+Math.sqrt(1+8*targetFrom))/2);
float v2=(float) ((-1+Math.sqrt(1+8*targetEnd))/2);
//mSpeed=(v1+Math.random()*(v2-v1));
mSpeed=v1;
isShouldEnd=false;
}