Skip to content

Instantly share code, notes, and snippets.

@kenmori
Last active March 19, 2017 02:24
Show Gist options
  • Save kenmori/061a2fe1060b209af5d4f0f40eca431c to your computer and use it in GitHub Desktop.
Save kenmori/061a2fe1060b209af5d4f0f40eca431c to your computer and use it in GitHub Desktop.
【canvas#arc()】ラジアンとは。開始位置角度と終了位置 角度
//初期化
ctx.beginPath();
// 開始角度
var s = 0;
//求めたい角度
var n = 45;
// 円の中心。x座標を100にする
// 円の中心。y座標を100にする
// この「点」から
// 半径50
// の
// 開始位置・・・0度
// で
// 終了位置・・・45度
// を
// 反時計回りで描く
ctx.arc(100, 100, 50, s, n*Math.PI/180, true)
//描画する
ctx.stroke();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment