Happy PI Day 2017!
A party to study mathematics, learning how to use new technologies, make coding experience, organizing a cultural event, to have fun, meet, share, give space to creativity and inclusion, because everyone has something to give to others and together they learn better and live better!
Work in progress in the previous days...
Calcolo di pi-greco col metodo di esaustione di Archimede
- Algoritmo (link)
- Diagramma di flusso (link)
- Valori calcolati col foglio di calcolo (link)
The calculation of pi-greek with the method of exhaustion of Archimedes
- Algorithm (link)
- Flowchart (link)
- Values calculated with the spreadsheet (link)
... but were also made researches the Internet, they were prepared billboards, sweet and scripts to celebrate in the presence and virtually in Edmondo!
//script che calcola la lunghezza di una circonferenza di raggio fissato
// Script that calculates the length of a circumference of fixed radius
// script for Pi day 2017 by ITE Rogliano (Cs)
touch_start(integer count)
llSay(0, "Happy PI DAY 2017!");
llSay(0, "This script calculates the length of a circumference");
llOwnerSay("Type in chat the length of the radius");
llListen(0, "", llGetOwner(), "");
listen(integer _chan, string _str, key _id, string _msg)
float number=(float)_msg;
llOwnerSay("The length of the circumference of radius " + (string)number + " is " + (string)c);
----------------------------------------------------------------------------------------------------------------------
//Script for PI DAY By ITE Rogliano (Cs)
//insert in the content of rezzer an object temporary named nuvola
//si inserisce una nuvola temporanea con le particelle, la rezza a forma di Circonferenza
plot(vector x)
{
string modo="rez";
llRezObject("nuvola",x,ZERO_VECTOR,ZERO_ROTATION,0);
}
vector calcolapos(integer angle)
{
float rad=DEG_TO_RAD*angle;
return (4*llCos(rad)*u+4*llSin(rad)*(v)+center);
}
vector u; vector v;
vector center;
integer angle;
default
{
touch_start(integer total_number)
{
llSetText("Clic to rez \na circumference", <0>,1); 0>
<0>
0>
v=llVecNorm(llRot2Left(llGetRot()));
u=llVecNorm(llRot2Fwd(llGetRot()));
center=llGetPos();
// metodo con il timer
angle=0;
llSetTimerEvent(0.01);
}
timer()
{
vector pos=calcolapos(angle);
plot(pos);
angle+=10;
if(angle>360) llSetTimerEvent(0);
}
}
Author: Rosa Marincola