I
ichonline
Gast
Hallo, ich bin nun seit ein paar Monaten in der Informatik AG und da bekoommen wir auch immer Hausaufgaben.
Diesmal soollen wir ein drehendes Poolygon machen. Also ein Dreieck und das dreht sich um seine unterste Ecke.
wir haben dazu ein paar formeln bekoommen. alsoo das habe ich schon..
mein problem ist mein sin und cos und pi werden nicht erkannt und ich weiß nicht in welcher reihenfolge etc. dass hin muss. Vielleicht önnt ihr mir ja helfen.
}
}
Diesmal soollen wir ein drehendes Poolygon machen. Also ein Dreieck und das dreht sich um seine unterste Ecke.
wir haben dazu ein paar formeln bekoommen. alsoo das habe ich schon..
Code:
mport java.awt.*;
import java.applet.*;
public class Drehendesdreieck extends Applet {
public void init() {
}
public void paint(Graphics g) {
int alpha=30;
int x[] = { 270,400,350};
int y[] = { 150,70,180};
int a = x.length;
g.drawPolygon(x,y,a);
soo jetzt habe ich ncoh xnew=x*cos*alpha-y*sin*alpha
ynew=x*sin*alpha-y*cos*alpha
math.sin()
math.cos()
doubleb==math.pi/180*alpha
}
}