Three pictures generated by mathematical formulae that are anagrams of one another.
(Click once on this picture to view another; may take a few moments to redraw)
If the applet pictures do not appear, click on the thumbnails below to view a (lower-quality) full-size version of that picture. (187KB, 237KB, 142KB respectively)
Each picture is 512*512 pixels, with a horizontal i-axis (increasing left to right) and a vertical j-axis (increasing top to bottom). The i-coordinate and j-coordinate of each pixel are used to determine the colour at that point using the following anagrammatic formulae (re = red, gr = green, bl = blue):
re = 255*ln(abs(i-j)) |
|
re = 255*(cot(i/32.0)/cot(j/32.0)) |
|
re = 255*(cos(i/32.0)*cos(j/32.0)) |
The above formulae are strict anagrams in which every letter, digit and symbol is accounted for.
Each value of re, gr, bl was mapped into the range of acceptable colours by making it an integer from 0 to 255. This was done by making the value positive, rounding it to an integer then finding the remainder when divided by 256:
x = (int)(abs(x))%256
In the code below, this was achieved using "inrange(x)". Dummy mathematical expressions have also been employed to simplify the code (but also because ln() is named log() in Java, cot() is not provided at all, and typing Math.xxx() all the time is clunky).
//Picture drawing code import javax.swing.*; import java.awt.*; import java.awt.event.*; public class GramPicPanel extends JPanel { private int picNo = 0; public GramPicPanel () { setBackground(Color.white); addMouseListener(new MouseAdapter () { public void mousePressed(MouseEvent e) { picNo = (picNo+1)%3; repaint(); } }); } public void paintComponent (Graphics g) { super.paintComponent(g); int re, gr, bl; for (int i=0; i<512; i++) { for (int j=0; j<512; j++) { if (picNo == 0) { re = inrange(255*ln(abs(i-j))); bl = inrange(255*cos(i/32.0)/cot(i/32.0) + tan((i+j)/(52127/151.0))); gr = inrange(-2.0*re); } else if (picNo == 1) { re = inrange(255*(cot(i/32.0)/cot(j/32.0))); bl = inrange(255*(asin(i/512.0)+asin(j/512.0))); gr = inrange((7*2)-1 + re - bl); } else { re = inrange(255*(cos(i/32.0)*cos(j/32.0))); bl = inrange(255*(tan(i/512.0)/tan((i+j)/512.0))); gr = inrange(127 - re - bl + i); } g.setColor(new Color(re, gr, bl)); g.fillRect(i, j, 1, 1); } } } private double abs(double x) { return Math.abs(x); } private double abs(int x) { return Math.abs(x); } private double sin(double x) { return Math.sin(x); } private double cos(double x) { return Math.cos(x); } private double tan(double x) { return Math.tan(x); } private double cot(double x) { return 1/(Math.tan(x)); } private double asin(double x) { return Math.asin(x); } private double ln(double x) { return Math.log(x); } private int inrange(double x) { return (int)(abs(x))%256; } private int inrange(int x) { return (int)(abs(x))%256; } }
//Applet display code import java.awt.*; import javax.swing.*; public class GramPicApplet extends JApplet { private GramPicPanel disp = new GramPicPanel(); public void init () { Container cp = getContentPane(); disp.setBounds(0,0,512,512); cp.setLayout(null); cp.add(disp); } }
Home |
| The Anagrammy Awards | Enter the Forum | Facebook | The Team |
|
Information |
| Awards Rules | Forum FAQ | Anagrams FAQ | History | Articles |
|
Resources |
| Anagram Artist Software | Generators | On-line | Books | Websites |
|
Archives |
| Winners | Nominations | Hall of Fame | Anagrammasia | Literary | Specials |
|
Competition |
| Vote | Current Nominations | Leader Board | Latest Results | Old Results | Rankings |
|
Miscellaneous |
| Tribute Page | Records | Sitemap | Search | Anagram Checker | Email Us | Donate |
|
Anagrammy Awards |
© 1998-2024 |