UNPKG

@hakit/components

Version:
3 lines (2 loc) 611 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=([[t,s],[c,o]],[a,r])=>[t*a+s*r,c*a+o*r],j=t=>[[Math.cos(t),-Math.sin(t)],[Math.sin(t),Math.cos(t)]],y=([t,s],[c,o])=>[t+c,s+o],M=t=>t/180*Math.PI,p=t=>{const{x:s,y:c,r:o,start:a,end:r,rotate:A=0}=t,d=s,P=c,h=o,i=o,n=M(a),e=(M(r)-n)%(2*Math.PI),g=M(A),l=j(g),[I,f]=y(u(l,[h*Math.cos(n),i*Math.sin(n)]),[d,P]),[v,R]=y(u(l,[h*Math.cos(n+e),i*Math.sin(n+e)]),[d,P]),S=e>Math.PI?1:0,b=e>0?1:0;return["M",I,f,"A",h,i,g/(2*Math.PI)*360,S,b,v,R].join(" ")};exports.svgArc=p;exports.toRadian=M; //# sourceMappingURL=svg-arc.js.map