360) { arc = 360; } // Flash uses 8 segments per circle, to match that, we draw in a maximum // of 45 degree segments. First we calculate how many segments are needed // for our arc. segs = Math.ceil(Math.abs(arc)/45); // Now calculate the sweep of each segment segAngle = arc/segs; // The math requires radians rather than degrees. To convert from degrees // use the formula (degrees/180)*Math.PI to get radians. theta = -(segAngle/180)*Math.PI; // convert angle startAngle to radians angle = -(startAngle/180)*Math.PI; // if our arc is larger than 45 degrees, draw as 45 degree segments // so that we match Flash's native circle routines. if (segs>0) { // Loop for drawing arc segments for (var i = 0; i ?> var start = canvas.start.slider.value; var end = canvas.end.slider.value; var cw = canvas.cw.cb.value; var dtor = Math.PI/180; this.clear(); //--- //draw the circle that is contains in our bounds //--- this.beginPath(); this.arc(this.width/2, this.height/2, this.width/2, 0 * dtor, 360, cw); this.strokeStyle = 0xAAAAAA; this.lineWidth = 1; this.stroke(); //--- //draw the circle for which the arc function is drawing a //a segment of //--- this.beginPath(); this.arc(this.width/2, this.height/2, this.width/2, start * dtor, 360, cw); this.strokeStyle = 0x000000; this.lineWidth = 1; this.stroke(); //--- // draw the segment itself //--- this.beginPath(); this.arc(this.width/2, this.height/2, this.width/2, start * dtor, end * dtor, cw); this.strokeStyle = 0xFF0000; this.lineWidth = 3; this.stroke(); Start Angle canvas.dv.drawTestArc(); End Angle canvas.dv.drawTestArc(); Clockwise canvas.dv.drawTestArc();