• API
• FAQ
• Tools
• Archive
daily pastebin goal
8%
SHARE
TWEET

# Untitled

a guest Dec 15th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. var angle = 104;
2. var offset = [0,0];
3. var scales = [40,40];
4. var rects = [[offset[0],offset[1]],[offset[0],offset[1]+scales[1]],[offset[0]+scales[0],offset[1]+scales[1]],[offset[0]+scales[0],offset[1]]];
5. for(var i = 0; i < rects.length; i++) {
6.     var trects = rects[i];
7.     //rects[i][0]=sin(angle)*Math.sqrt(Math.pow(rects[i][1],2)+pow(rects[i][0],2));
8.     //rects[i][1]=cos(angle)*Math.sqrt(Math.pow(rects[i][1],2)+pow(rects[i][0],2));
9.     rects[i][0]=trects[0]*Math.cos(angle*2*PI/360)-trects[1]*Math.sin(angle*2*PI/360)+200;
10.     rects[i][1]=trects[1]*Math.cos(angle*2*PI/360)+trects[0]*Math.sin(angle*2*PI/360)+200;
11. }
12.
13. for(var i = 0; i < rects.length; i++) {
14.     strokeWeight(10);
15.     //point(rects[i][0], rects[i][1]);
16.     strokeWeight(1);
17.     if(i === 0){
18.         line(rects[0][0],rects[0][1],rects[3][0],rects[3][1]);
19.     }else{
20.         line(rects[i][0],rects[i][1],rects[i-1][0],rects[i-1][1]);
21.     }
22.     //println(rects[i]);
23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top