Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     var sectionCount = 4;
  2.     var perimeter = 400;
  3.  
  4.  
  5.     //3 sections
  6.     //[0, 1]
  7.     //[0.5, 0.5]
  8.     //[0.5, -0.5]
  9.  
  10. //    180 / sectionCount
  11. //    180 / sectionCount * 7 = 315;
  12. //    180 / sectionCount * 7 = 315;
  13.  
  14.     for(var i = 0; i < sectionCount; ++i){
  15.         var minVectorLength = perimeter * i / sectionCount; //may not need
  16.         var maxVectorLength = perimeter * (i+1) / sectionCount;//may not need
  17.         var angleInDegrees = 180 / sectionCount - (i * 360/sectionCount);
  18.         var angleInRadians = angleInDegrees * (Math.PI/180);
  19.         var unitVector = [Math.cos(angleInRadians), Math.sin(angleInRadians)];
  20.  
  21.         console.log(angleInDegrees);
  22.  
  23.         //startingPoint = [0, 0];
  24.         //unitVector  = [0.5, 0.5]
  25.  
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement