import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.awt.Color;
import java.io.*;
import javax.imageio.*;
import
[link].Point2D.Float;
import java.util.ArrayList;
public class Main{
public static final int height=1000;
public static final double Hyp=height/Math.sin(Math.toRadians(72));
public static final double SHRINK=Math.sin(Math.toRadians(38));
public static void main(String[] args){
ArrayList<Float> list=new ArrayList(12000);
double rev=1;
double size=1;
double x=300;
double y=height;
list.add(new Float((float)x,(float)y));
for(int i=0;i<3000;i++)
{
x+=Hyp*Math.cos(Math.toRadians(72))*size;
y-=Hyp*Math.sin(Math.toRadians(72))*size*rev;
list.add(new Float((float)x,(float)y));
x+=Hyp*Math.cos(Math.toRadians(72))*size;
y+=Hyp*Math.sin(Math.toRadians(72))*size*rev;
list.add(new Float((float)x,(float)y));
x-=Hyp*Math.cos(Math.toRadians(36))*size;
y-=Hyp*Math.sin(Math.toRadians(36))*size*rev;
list.add(new Float((float)x,(float)y));
x+=Hyp*size;
y=y+0;
list.add(new Float((float)x,(float)y));
size*=SHRINK;
rev*=-1;
}
//this creates a picture, makes the background white, and generates a graphics item
BufferedImage pic=new BufferedImage(4000,height,BufferedImage.TYPE_BYTE_GRAY);
Graphics2D g

Graphics2D)pic.getGraphics();
g.setColor(Color.WHITE);
g.fillRect(0,0,4000,height);
g.setColor(Color.black);
//this draws the lines
for(int i=1;i<list.size();i++)
g.drawLine((int)list.get(i-1).getX(), (int)list.get(i-1).getY(), (int)list.get(i).getX(), (int)list.get(i).getY());
//this saves the newly created picture
File file=new File("output.jpg");
try{
ImageIO.write(pic,"jpg",file);
}catch(Exception e){}
}
}
--
"Anybody have a life?.....That I can borrow?"
Forgive and Forget.....But keep a list of names
--
toolshed333
[link]
--
Me & U only...just Me & U....
--
Kerem Bektas
Previous PageNext Page