nl_tokens: Cubic bezier approximation of a circular arc centered at the origin from ( radians ) a1 to a2 where a2 - a1 < pi / 2 . The arc s radius is r .
pl_tokens: function createSmallArc ( r , a1 , a2 ) { var a = ( a2 - a1 ) / 2.0 ; var x4 = r * Math . cos ( a ) ; var y4 = r * Math . sin ( a ) ; var x1 = x4 ; var y1 = - y4 ; var q1 = x1 * x1 + y1 * y1 ; var q2 = q1 + x1 * x4 + y1 * y4 ; var k2 = 4 / 3 * ( Math . sqrt ( 2 * q1 * q2 ) - q2 ) / ( x1 * y4 - y1 * x4 ) ; var x2 = x1 - k2 * y1 ; var y2 = y1 + k2 * x1 ; var x3 = x2 ; var y3 = - y2 ; var ar = a + a1 ; var cos_ar = Math . cos ( ar ) ; var sin_ar = Math . <mask> ( ar ) ; return { x1 : r * Math . cos ( a1 ) , y1 : r * Math . sin ( a1 ) , x2 : x2 * cos_ar - y2 * sin_ar , y2 : x2 * sin_ar + y2 * cos_ar , x3 : x3 * cos_ar - y3 * sin_ar , y3 : x3 * sin_ar + y3 * cos_ar , x4 : r * Math . cos ( a2 ) , y4 : r * Math . sin ( a2 ) } ; }