HTML အကိုးအကား

အက္ခရာဖြင့် HTML HTML အမျိုးအစားအလိုက် HTML Browser ပံ့ပိုးမှု HTML အရည်အချင်းများ HTML ကမ္ဘာလုံးဆိုင်ရာ အရည်အချင်းများ HTML ပွဲများ HTML အရောင်များ HTML Canvas HTML အသံ/ဗီဒီယို HTML အက္ခရာအစုံများ HTML Doctypes HTML URL ကုဒ် HTML ဘာသာစကားကုဒ်များ HTML နိုင်ငံကုဒ်များ HTTP မက်ဆေ့ခ်ျများ HTTP နည်းလမ်းများ PX မှ EM Converter ကီးဘုတ်ဖြတ်လမ်းများ


HTML canvas arc() နည်းလမ်း

❮ HTML Canvas အကိုးအကား

ဥပမာ

စက်ဝိုင်းတစ်ခု ဖန်တီးပါ-

သင်၏ဘရောက်ဆာသည် HTML5canvastag ကိုမပံ့ပိုးပါ။

JavaScript-

var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.beginPath();
ctx.arc(100, 75, 50, 0, 2 * Math.PI);
ctx.stroke();

Browser ပံ့ပိုးမှု

ဇယားရှိ နံပါတ်များသည် နည်းလမ်းကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးသည်။

Method
arc() Yes 9.0 Yes Yes Yes

အဓိပ္ပါယ်နှင့် အသုံးပြုမှု

arc() method သည် arc/curve (စက်ဝိုင်းများဖန်တီးရန်အသုံးပြုသည်၊ သို့မဟုတ် စက်ဝိုင်း၏အစိတ်အပိုင်းများ) ကိုဖန်တီးသည်။

အကြံပြုချက်- arc() ဖြင့် စက်ဝိုင်းတစ်ခုကို ဖန်တီးရန်- စတင်ထောင့်ကို 0 နှင့် အဆုံးသတ်ထောင့်ကို 2*Math.PI သို့ သတ်မှတ်ပါ။

အကြံပြုချက်- ကင်းဗတ်စ်ပေါ်တွင် အနားကို အမှန်တကယ်ဆွဲရန် stroke () သို့မဟုတ် fill() နည်းလမ်းကို အသုံးပြုပါ။

ထောင့်တစ်ခု

စင်တာ
arc( 100,75 ,50,0*Math.PI,1.5*Math.PI)
စတင်ထောင့်
arc(100,75,50, 0 ,1.5*Math.PI)
ထောင့်စွန်း
arc(100,75,50,0*Math.PI, 1.5*Math.PI )

JavaScript syntax- ဆက်စပ်မှု .arc( x,y,r,sAngle,eAngle,clockwise );

ကန့်သတ်တန်ဖိုးများ

Parameter Description Play it
x The x-coordinate of the center of the circle
y The y-coordinate of the center of the circle
r The radius of the circle
sAngle The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)
eAngle The ending angle, in radians
counterclockwise Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise.

❮ HTML Canvas အကိုးအကား