Originally Posted by
Wlada
Yes your formula works. Nice way to avoid divide-by-zero error.
Wow, now we have a plenty formulas for the same job! But, your last is the shorter. Thanks, I also learn a lot.
I have been trying a new challenge with these types of formulas, try to fit a calculator into a tweet. I have this one down to a little under two tweets.
Code:
javascript:m=Math,a=0,b=-10,c=88,e=0,f=-2,g=0;function r(x){return x*m.PI/180};h=a+b/2+e+f/2;i=b*m.cos(r(2*c))+f*m.cos(r(2*g));j=b*m.sin(r(2*c))+f*m.sin(r(2*g));k=m.sqrt(m.pow(i,2)+m.pow(j,2));l=h-k/2;m=(m.atan2(j,i)/2)*180/m.PI;m=(m<0)?m+180:m;alert("S:"+l+"C:"+k+"A:"+m);
Bookmarks