Archive

math for artists

search parameter: ‘ 🙂 ‘

word freq
que 20
aku 18
zaynmalik 18
follow 17
love 17
hope 13
good 12
haha 12
kamu 12
sama 12
gak 11
dont 10
birthday 9
hahaha 9
kita 9
like 9
lol 9
please 9
ada 8
day 8
happy 8
itu 8
video 8
youre 8

01.

 

search parameter: ‘ 😦 ‘

word freq
que 31
gak 6
mas 6
pra 6
dormir 5
hate 5
los 5
voy 5
— 4
ahora 4
ako 4
boleh 4
con 4
las 4
maãana 4
nadie 4
now 4
quiero 4
tau 4
vida 4
∠3
como 3
des 3
dito 3

02_sadface.

search parameter: ‘ serbia ‘

word freq
serbia 1229
travel 665
rusia 449
sanksi 438
jatuhkan 414
takkan 412
atas 410
traveleurope 335
httptcokgchoebwso 330
talkingsloth 330
tomaco 330
vucic 302
aleksandar 211
menteri 210
perdana 210
meminta 199
komisaris 189
perluasan 178
nyatakan 97
eropa 40
fule 32
stefan 32
yang 32
berikan 25

serbia

.

search parameter: ‘ srbijo ‘

srbijo

search parameter: ‘ nyc ‘

nyc

search parameter: ‘ beograd’ beograd

search parameter: ‘ itp’

itp

search parameter: ‘ wtf ‘ wtf

 

.

sentiment analysis, when tweeting about ITP and staying late-nights:


Rplot02 LATE STAYING ALL 3 itp

 

 

Imagined as big-scale installation or digital projection; Also flock (boids) are suppose to generate music when moving.

.

Flock is conducted with Leap motion, using hand tracking. For actual, planed installation I might use Kinect for motion tracing and conducting to utilize more body parts and more complex motions, instead of just one hand.

 

processing sketch : here :

Embedded data visualization / general data piece data used on social networks using flocking algorithm.

Will try to represent each user as 1 flock and data through boids. I would visualize interactions between users which will be represented with flock and boids. Many flock in one screen.

Maybe groups of boids inside a flock? Different data sets with different rules? What is uploading data or downloading data? What I think will be interesting is showing everyday ‘data interactions’ that we are not quite aware of.

Have no idea how to get data; Vague idea how to assign rules; And not sure what will I find out.

output_ZrvG8i

.HOW IT WORKS:


(code is for processing and I used Daniel Shiffman’s Flocking example to brake it down; although the concept  and principles should be applicable in any of programming languages)

There are  three simple rules of flocking behaviors:
alignment,  cohesion, and separation, 
which when used in combination display the full flocking behavior.
Lets see what happens there.

.

ALIGMENT:

00 aligment

A behavior that causes a particular boid to line up with boids close by.
We iterate through all of the boids and find the ones within the neighbor radius – that is, those close enough to be considered neighbors of the specified boid. If boid is found within the radius, its velocity is added to the computation vector, and the neighbor count is incremented.

PVector align (ArrayList<Boid> boids) {
float neighbordist = 50;
PVector sum = new PVector(0, 0);
int count = 0;
for (Boid other : boids) {
float d = PVector.dist(location, other.location);
   if ((d > 0) && (d < neighbordist)) {                                    //why do we need (d > 0)?
      sum.add(other.velocity);
      count++;
}
}

Than we divide the computation vector by the neighbor count and normalize it (divide it by its length to get a vector of length, obtaining the final resultant vector. And of course, we will not do step above if there are no neighbors, and we will simply return zero vector (0,0).

if (count > 0) {
   sum.div((float)count);                                                  // why do we need to div if we use .setMag after?
   sum.setMag(maxspeed);
   PVector steer = PVector.sub(sum, velocity);
   steer.limit(maxforce);
   return steer;
   } else {
   return new PVector(0, 0);
}

01

0203040607

.

.

COHESION

00 cohesion

Cohesion is a behavior that causes boids to steer towards thecenter of mass” – that is, the average position of the boids within a certain radius.

The implementation is almost identical to that of the alignment behavior, but there are some key differences. First, instead of adding the velocity to the computation vector, the position is added instead.

Like before, the computation vector is divided by the neighbor count, resulting in the position that corresponds to the center of mass. However, we don’t want the center of mass itself, we want the direction towards the center of mass, so we recompute the vector as the distance from the boid to the center of mass. Finally, this value is normalized and returned.

PVector cohesion (ArrayList<Boid> boids) {
float neighbordist = 50;
PVector sum = new PVector(0, 0);            // Start with empty vector to accumulate all locations
int count = 0;
for (Boid other : boids) {
   float d = PVector.dist(location, other.location);
   if ((d > 0) && (d < neighbordist)) {
   sum.add(other.location);                     // Add location
   count++; }
}
   if (count > 0) {
   sum.div(count);
   return seek(sum);                                   // Steer towards the location
} else {
return new PVector(0, 0);
}}

.

.

SEPARATION

00 separation

Separation is the behavior that causes an boid to steer away from all of its neighbors.

The implementation of separation is very similar to that of alignment and cohesion. When a neighboring boid is found, the distance from the boid to the neighbor is added to the computation vector. The computation vector is divided by the corresponding neighbor count, but before normalizing, there is one more crucial step involved. The computed vector needs to be negated in order for the boid to steer away from its neighbors; and we do that by subtracting target location from our boid’s location.

PVector diff = PVector.sub(location, other.location);               //not  .sub(other.location ,location);

.

.

STEER VECTOR     // Steering = Desired minus Velocity

   PVector desired = PVector.sub(target, location);      // A vector pointing from the location to the target
   // Scale to maximum speed
   desired.setMag(maxspeed);

   PVector steer = PVector.sub(desired, velocity);
   steer.limit(maxforce);                                           // Limit to maximum steering force
   return steer;

.

.

.

After getting the principles of the algorithm, this is what we should do in processing to make it work:

00. MAKE OUR GUYS and Pvect variables

// The Flock (an array of Boid objects)
flock = new Flock();
// Add an initial set of boids into the system
   for (int i = 0; i < 150; i++) {
    flock.addBoid(new Boid(width/2,height/2));
}

PVector location;
PVector velocity;
PVector acceleration;
float r;

01. ASIGN THESE RULS TO EACH BOID with magic numbers :

void flock(ArrayList<Boid> boids) {
   PVector sep = separate(boids);    // Separation
   PVector ali = align(boids);              // Alignment
   PVector coh = cohesion(boids);   // Cohesion
   // Arbitrarily weight these forces            // magic numbers for forces to work nicely
   sep.mult(1.5);
   ali.mult(1.0);
   coh.mult(1.0);
   // Add the force vectors to acceleration
   applyForce(sep);
   applyForce(ali);
   applyForce(coh);
}

02. CONNECT THEM AND APPLY through acceleration vector:   

void applyForce(PVector force) {
acceleration.add(force);
}

// Method to update location
void update() {
   // Update velocity
   velocity.add(acceleration);
   // Limit speed
   velocity.limit(maxspeed);
   location.add(velocity);
   // Reset accelertion to 0 each cycle
   acceleration.mult(0);
}

.

.

.

complete Daniel Shiffman flocking example and code : here :

code for processing sketch that post begins with : here :

huge png presentation file here :

.

.

nema1.1393556708192

simplest explanation of pie:   math for kids

.

more,

-there is a world expert in Pi, David Baley?

This episode was obviously created before 1995, recording to world record chart for memorizing Pi.

“The record for memorizing Pi was achieved by Chao Lu (China) who recited Pi from memory to 67,890 places, at the Northwest A&F University, Shaanxi province, China, on 20 November 2005. Chao Lu, a chemistry student, attempted the record after practising for 4 years. The attempt lasted 24 hrs 4 min and was recorded on 26 video tapes. News reports from CCTV (China Central Television) and from Yangling TV submitted with the claim. The attempt was witnessed by 8 officials, Maths professors of the NWAFU and 20 students to assist the witnesses.”

and how Pi was nearly changed to 3.2!

.

and some cool facts here