以弧度為單位的隨機角度

function randomAngleRadians():Number
{
    return Math.random() * Math.PI * 2;
}

示例輸出:

  • 5.490068569213088
  • 3.1984284719180205
  • 4.581117863808207