import java.awt.*;
import java.applet.Applet;
public class assig3 extends Applet{
public void paint(Graphics g){
//draw25Circles(g, 20);
//draw25Circles(g, 40);
letterL(g, 100, 100, 10);
letterL(g, 150, 100, 20);
letterL(g, 200, 100, 40);
letterL(g, 100, 200, 200);//biggest
}
private void drawTriangle(Graphics g, int bottomX, int bottomY, int base, int height){
g.drawLine(bottomX, bottomY, bottomX + base, bottomY);
g.drawLine(bottomX+base, bottomY, bottomX+base/2, bottomY-height);
g.drawLine(bottomX+base/2, bottomY-height, bottomX, bottomY);
}
private void drawTriangle2(Graphics g, int X1, int Y1, int X2, int Y2, int X3, int Y3){
g.drawLine(X1, Y1, X2, Y2);
g.drawLine(X1, Y1, X3, Y3);
g.drawLine(X2, Y2, X3, Y3);
}
private void drawCircle(Graphics g, int centerX, int centerY, int radius){
g.drawOval(centerX-radius, centerY-radius, 2*radius, 2*radius);
}
private float toInches(float centimeters){
return centimeters*0.394f;
}
private float areaCircle(float radius){
return 3.1416f*radius*radius;
}
private int doubled(int num){
return 2*num;
}
private void drawCirclesRow(Graphics g, int y){
drawCircle(g, 20, y, 10);//First Circle
drawCircle(g, 60, y, 10);//Second Circle
drawCircle(g, 100, y, 10);
drawCircle(g, 140, y, 10);
drawCircle(g, 180, y, 10);
}
private void draw25Circles(Graphics g, int y){
drawCirclesRow(g, y);//First row
drawCirclesRow(g, y+40);//Second row
drawCirclesRow(g, y+80);
drawCirclesRow(g, y+120);
drawCirclesRow(g, y+160);
}
private void letterL(Graphics g, int x, int y, int h){
g.setColor(Color.red);
/*
Preliminary design
g.drawRect(x,y, h/8, h);
g.drawRect(x-h/8, y, 3*h/8, h/8);
g.drawRect(x-h/8, y +h-h/8, (3*h)/4, h/8);
g.drawRect(x-h/8+(3*h)/4-h/8, y +h-h/8-h/8, h/8, 2*h/8);
*/
g.fillRect(x,y, h/8, h);
g.fillRect(x-h/8, y, 3*h/8, h/8);
g.fillRect(x-h/8, y +h-h/8, (3*h)/4, h/8);
g.fillRect(x-h/8+(3*h)/4-h/8, y +h-h/8-h/8, h/8, 2*h/8);
}
}