Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var sectionCount = 4;
- var perimeter = 400;
- //3 sections
- //[0, 1]
- //[0.5, 0.5]
- //[0.5, -0.5]
- // 180 / sectionCount
- // 180 / sectionCount * 7 = 315;
- // 180 / sectionCount * 7 = 315;
- for(var i = 0; i < sectionCount; ++i){
- var minVectorLength = perimeter * i / sectionCount; //may not need
- var maxVectorLength = perimeter * (i+1) / sectionCount;//may not need
- var angleInDegrees = 180 / sectionCount - (i * 360/sectionCount);
- var angleInRadians = angleInDegrees * (Math.PI/180);
- var unitVector = [Math.cos(angleInRadians), Math.sin(angleInRadians)];
- console.log(angleInDegrees);
- //startingPoint = [0, 0];
- //unitVector = [0.5, 0.5]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement