miércoles, 25 de septiembre de 2024
Práctica 4
Práctica 3
Car myCar1;
Car myCar2;
Car myCar3;
void setup() {
size(200,200);
myCar1 = new Car(color(255,0,0),0,100,2);
myCar2 = new Car(color(0,0,255),0,10,1);
myCar3 = new Car(color(0,255,0),-200,55,-2);
}
void draw() {
background(255);
myCar1.drive();
myCar1.display();
myCar2.drive();
myCar2.display();
myCar3.drive();
myCar3.display();
}
class Car {
color c;
float xpos;
float ypos;
float xspeed;
Car(color tempC, float tempXpos, float tempYpos, float tempXspeed) {
c = tempC;
xpos = tempXpos;
ypos = tempYpos;
xspeed = tempXspeed;
}
void display() {
stroke(0);
fill(c);
rectMode(CENTER);
rect(xpos,ypos,20,10);
}
void drive() {
xpos = xpos + xspeed;
if (xpos > width) {
xpos = 0;
}
if (xpos < 0) {
xpos = width;
}
}
}
Práctica 2
int cateto1=200;
int cateto2=300;
float h;
float a;
float angulo;
void setup(){
size(600,600);
background(255);
noLoop();
}
void draw(){
h=hipotenusa(cateto1,cateto2);
a=area(cateto1,cateto2);
angulo=anguloM(cateto1,cateto2);
dibujar();
}
void dibujar(){
fill(255,0,0);
textSize(20);
text("Hipotenusa="+nf(h,0,2),150,100);
text("Área="+nf(a,0,2),150,125);
text("Ángulo menor="+nf(angulo,0,2),150,150);
triangle(200,400,400,200+cateto1,100+cateto2,300);
}
float hipotenusa(float cate1,float cate2){
float hipo;
hipo=sqrt((cate1)*(cate1)+(cate2)*(cate2));
return hipo;
}
float area(float cate1,float cate2){
float farea;
farea=(cate1*cate2)/2;
return farea;
}
float anguloM(float cate1, float cate2){
float angM;
float t1;
float t2;
t1=(360*(atan(cate1/cate2)))/(2*PI);
t2=(360*(atan(cate2/cate1)))/(2*PI);
angM=min(t1,t2);
return angM;
}
martes, 17 de septiembre de 2024
Práctica 1
Proyecto GPS
PROYECTO GPS Aquí adjunto el proyecto del GPS, están tanto el build como la carpeta de Solar2S en el mismo comprimido. Proyecto GPS
-
PROYECTO GPS Aquí adjunto el proyecto del GPS, están tanto el build como la carpeta de Solar2S en el mismo comprimido. Proyecto GPS
-
MICRÓFONOS Según su tecnología: Dinámico: Poco sensible. Para los reporteros en la calle, conciertos, lugares con ruido. De condensador: S...