This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
matrix planeToPlaneOrientation(vector upos; vector u1; vector u2; vector vpos; vector v1; vector v2) { | |
vector u3 = normalize(cross(u1, u2)); | |
vector v3 = normalize(cross(v1, v2)); | |
matrix3 U = set(u1, u2, u3); | |
matrix3 V = set(v1, v2, v3); | |
matrix3 rotmat = transpose(U) * V; | |
matrix mat = ident(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void RunScript(double ang, ref object A) | |
{ | |
double dang = ang * Math.PI / 180.0; | |
int div1 = (int) Math.Round(Math.PI / dang); | |
List<Point3d> points = new List<Point3d>(); | |
for(int i = 0; i < div1; i++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r=64 | |
t=0 | |
function _draw() | |
cls(1) | |
for n=0,6,1 do | |
for i=0,100,1 do | |
ang=3.1415/180.0*2 | |
x1=cos((i+t)*ang)*i+r | |
y1=sin((i+t)*ang)*i+r | |
x2=cos((i+1+t)*ang)*(i+1)+r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r=128 | |
t=0 | |
num=4 | |
rad=9 | |
sp=0.5 | |
function _draw() | |
cls(13) | |
val=sin(330/360) | |
nnum=ceil(num/val) | |
for i=0,num do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r=64 | |
function _draw() | |
cls(1) | |
--print("abc") | |
num=200.0 | |
rad=50 | |
xss={} | |
yss={} | |
sep=3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r=64 | |
function _draw() | |
cls(7) | |
circfill(r,r,r,0) | |
num=10 | |
speed=0.3 | |
rad=5 | |
seq=0.5 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r=64 | |
cr=6 | |
tn=150 | |
d=3 | |
s=0.05 | |
sm=10 | |
trx={} | |
try={} | |
for i=1,d do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
vals = [] | |
for i in range(7): | |
vals.append(random.random() * 100) | |
heap = [] | |
for i in range(len(vals)): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int res = chi("res"); | |
float rad = chf("rad"); | |
int poly = addprim(0, "polyline"); | |
for(int i=0; i<res; i++){ | |
float ang = $PI * 2 * chf("angmult") * i / (res - 1.0); | |
float rang = $PI * i / (res - 1.0); | |
float r = sin(rang) * rad; | |
float h = cos(rang) * rad; | |
float x = cos(ang) * r; | |
float z = sin(ang) * r; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function splinePt(points, i, n, t){ | |
let pt1, pt2; | |
if(n == 1){ | |
pt1 = points[i]; | |
pt2 = points[i+1]; | |
}else{ | |
pt1 = splinePt(points, i, n-1, t); | |
pt2 = splinePt(points, i+1, n-1, t); | |
} | |
let npt = p5.Vector.add(p5.Vector.mult(pt1, (1.0-t)), p5.Vector.mult(pt2, t)); |
NewerOlder