Skip to content

Instantly share code, notes, and snippets.

View andsve's full-sized avatar
🍎
Coding

Sven Andersson andsve

🍎
Coding
View GitHub Profile
# >> ones i ni eo a e idsorsah e totristhria nats idaseahehrndotaorth ids thei rnid nrt es et eotsaota th theoat neti oes e si ids ise th esrnar id a e idsi h t aserreona ehineotrartihth t nrth iherne ah se idr a esah ri a iah r ts e rneihed thrneirnes trnods stoth e restr
R T G M P D F A L H B U I X K O J S Z W N Y Q
-------------------------------------------------------------------------
R | 2 1 3 5 1 4 1 2 1 1 1 1 1 1
T | 4 1 2 8 2 2 1 2 1
G | 2 4 1 3 1 1 8 2 1 1
M | 1 3 1 1 7 1 1 1 2
P | 4 2 1 2 1 1 1 1 1 1 1 1 1
D | 4 1 3 1 1 3 1 1 1 1
F | 2 2 4 2 1 1 2 1
A | 5 2 2 2 1
float control_points[7*7*3];
for (int i = 0; i < (n->numpoints); i++) {
for (int a = 0; a < 7; a+=1) {
float angle = (float)a/7.0f * 2 * PI;
control_points[i*7*7+a*3] = n->p[i+1].x*cos(angle);
control_points[i*7*7+a*3+1] = n->p[i+1].y;
control_points[i*7*7+a*3+2] = n->p[i+1].x*sin(angle);
}
}
float control_points[7*7*3];
for (int i = 0; i < n->numpoints; i++) {
for (int a = 0; a < 7; a+=1) {
float angle = (float)a/7.0f * 2 * PI;
control_points[i*7*7+a*3] = n->p[i+1].x*cos(angle);
control_points[i*7*7+a*3+1] = n->p[i+1].y;
control_points[i*7*7+a*3+2] = n->p[i+1].x*sin(angle));
}
}