You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/05/18 07:22:24 UTC

[GitHub] [incubator-echarts] plainheart commented on issue #12649: how to solve this !!

plainheart commented on issue #12649:
URL: https://github.com/apache/incubator-echarts/issues/12649#issuecomment-629994924


   @Rranjansolenoid Hi, I'm not sure whether this issue is related to `echarts` or not and it was closed for not using [issue template](https://ecomfe.github.io/echarts-issue-helper/).
   It seems to be a mathematical problem. There are some example codes for you.
   ```js
   // circumference of the circle
   let c = 8 * 12; // feet to inch
   
   // the radius of circle
   let r = c / (2 * Math.PI);
   
   // target arc length we want to get
   let targetArcLength = 0.01;
   
   // the arc length of circle
   let arcLength = c;
   
   // fold count
   let foldCount = 0;
   
   // the center angle of circle
   let circleCenterAngle = 360;
   
   // loop until the arc length is less than 0.01
   while(arcLength >= 0.01) {
   	// calculate the center angle of circle by foldCount
   	circleCenterAngle = 360 * Math.pow(2, -foldCount);
   	// calculate the arc length(arcLength = nπr / 180)
   	arcLength = circleCenterAngle * Math.PI * r / 180.0;
   	// increases the foldCount
   	++foldCount;
   }
   
   console.log('foldCount', foldCount)
   ```
   Run it and then we can get the result `foldCount 15`. Is it expected?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org