Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Animowany pierścień (model siatkowy)
/*
* Created on 2005-06-15
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package rw.animacja;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Graphics;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.image.BufferStrategy;
import java.awt.image.MemoryImageSource;
import javax.swing.JFrame;
import javax.swing.Timer;
/**
* Animacja 3D - pierścień (model siatkowy)
*
* @author Rafał Wileczek
* @created 25 lipca 2006
*/
public class Animacja3D extends JFrame implements KeyListener, ActionListener {
private static final long serialVersionUID = 2596382981127077399L;
// Zmienne związane z przechodzeniem na pełny ekran
private GraphicsDevice device;
private GraphicsEnvironment environment;
private BufferStrategy strategy;
private Integer[][] torus = null;
private Integer[][] torus_pers = null;
Integer odl_ekr = 1000000;
Integer xo = 0;
Integer yo = 1;
Integer zo = 30;
Double rad_incr = 2 * Math.PI / 720;
Double kat = 0.0;
Integer dx;
Integer dy;
Integer siatka_length;
Integer wierzcholki;
private Timer timer = null;
private int czas = 10;
/**
* Konstruktor klasy Animacja3D
*
*/
public Animacja3D() {
// Ustawienia okna
setUndecorated(true);
setResizable(false);
// Okno odbiera zdarzenia z klawiszy
setFocusable(true);
addKeyListener(this);
// Anulowanie domyślnego odświeżania ekranu
setIgnoreRepaint(true);
// Pobranie "kontekstu urządzenia"
environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
device = environment.getDefaultScreenDevice();
siatka_length = Torus.siatka.length;
wierzcholki = Torus.torus_wzor.length;
torus = new Integer[wierzcholki][3];
torus_pers = new Integer[wierzcholki][2];
timer = new Timer(czas, this);
}
private void kopiujWzor() {
// Kopiowanie wzoru
for (int i = 0; i < wierzcholki; i++) {
for (int j = 0; j < 3; j++) {
torus[i][j] = Torus.torus_wzor[i][j];
}
}
}
// Przekształcenia afiniczne
private void torus_obrotY(double alfa) {
for (int i = 0; i < wierzcholki; i++) {
Double a = torus[i][0] * Math.cos(alfa) - torus[i][2]
* Math.sin(alfa);
Double b = torus[i][0] * Math.sin(alfa) + torus[i][2]
* Math.cos(alfa);
torus[i][0] = a.intValue();
torus[i][2] = b.intValue();
}
}
private void torus_obrotX(double alfa) {
for (int i = 0; i < wierzcholki; i++) {
Double a = torus[i][1] * Math.cos(alfa) - torus[i][2]
* Math.sin(alfa);
Double b = torus[i][1] * Math.sin(alfa) + torus[i][2]
* Math.cos(alfa);
torus[i][1] = a.intValue();
torus[i][2] = b.intValue();
}
}
private void torus_obrotZ(double alfa) {
for (int i = 0; i < wierzcholki; i++) {
Double a = torus[i][0] * Math.cos(alfa) - torus[i][1]
* Math.sin(alfa);
Double b = torus[i][0] * Math.sin(alfa) + torus[i][1]
* Math.cos(alfa);
torus[i][0] = a.intValue();
torus[i][1] = b.intValue();
}
}
private void torus_pers() {
for (int i = 0; i < wierzcholki; i++) {
torus_pers[i][0] = (torus[i][0] * 400) / (odl_ekr + torus[i][2])
+ dx;
torus_pers[i][1] = (torus[i][1] * 400) / (odl_ekr + torus[i][2])
+ dy;
}
}
private void paintCzarny() {
Graphics g = strategy.getDrawGraphics();
Rectangle rect = this.getBounds();
g.setColor(Color.black);
g.fillRect(rect.x, rect.y, rect.width, rect.height);
strategy.show();
}
/**
* Tworzy niewidoczny kursor
*
* @return niewidoczny kursor
*/
private Cursor createTransparentCursor() {
int[] pixels = new int[16 * 16];
Image image = Toolkit.getDefaultToolkit().createImage(
new MemoryImageSource(16, 16, pixels, 0, 16));
Cursor transparentCursor = Toolkit.getDefaultToolkit()
.createCustomCursor(image, new Point(0, 0), "invisiblecursor");
return transparentCursor;
}
/**
* Wejście w tryb pełnoekranowy
*/
private void setFullScreen() {
device.setFullScreenWindow(this);
// Double buffering
createBufferStrategy(2);
strategy = getBufferStrategy();
Rectangle r = this.getBounds();
dx = (int) (r.getMaxX() / 2);
dy = (int) (r.getMaxY() / 2);
}
/**
* Opuszczenie trybu pełnoekranowego
*/
private void exitFullScreen() {
device.setFullScreenWindow(null);
strategy = null;
}
/**
* Otwarcie okna i rozpoczęcie wyświetlania
*/
public void rozpocznijWyswietlanie() {
// Wejście w tryb pełnoekranowy
setFullScreen();
paintCzarny();
// Prezentacja okna
setCursor(createTransparentCursor());
setVisible(true);
timer.start();
}
private void kresl() {
// Przygotowujemy torus
torus_pers();
Graphics g = strategy.getDrawGraphics();
g.setColor(Color.black);
Rectangle r = this.getBounds();
g.fillRect(0, 0, r.width, r.height);
g.setColor(Color.GREEN);
// Rysujemy torus
for (int i = 0; i < siatka_length; i++) {
Integer p1 = Torus.siatka[i][0];
Integer p2 = Torus.siatka[i][1];
Integer x1 = torus_pers[p1][0];
Integer x2 = torus_pers[p2][0];
Integer y1 = torus_pers[p1][1];
Integer y2 = torus_pers[p2][1];
g.drawLine(x1, y1, x2, y2);
}
strategy.show();
}
/**
* Zamknięcie okna i przywrócenie wartości początkowych klasy
*/
public void zakonczWyswietlanie() {
timer.stop();
setCursor(null);
exitFullScreen();
setVisible(false);
System.exit(0);
}
// Akcja timera
public void actionPerformed(ActionEvent e) {
kopiujWzor();
torus_obrotX(2 * kat);
torus_obrotY(2 * kat / 3);
torus_obrotZ(kat / 2);
kresl();
kat += rad_incr;
}
// Interfejs KeyListener - implementacja
public void keyTyped(KeyEvent e) {
}
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
zakonczWyswietlanie();
} else if (e.getKeyCode() == KeyEvent.VK_UP) {
if (odl_ekr < 10000000)
odl_ekr += 50000;
} else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
if (odl_ekr > 100000)
odl_ekr -= 50000;
}
}
public void keyReleased(KeyEvent e) {
}
}
/**
*
*/
package rw.animacja;
import javax.swing.UIManager;
/**
* @author Rafał Wileczek
*
*/
public class Pierscien3D {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
// Wygląd "uniwersalny" Java SWING
try {
UIManager.put("swing.boldMetal", Boolean.FALSE);
UIManager.setLookAndFeel(UIManager
.getCrossPlatformLookAndFeelClassName());
} catch (Exception e) {
}
Animacja3D frame = new Animacja3D();
frame.rozpocznijWyswietlanie();
}
});
}
}
package rw.animacja;
/**
* Klasa zawierająca definicje wierzchołków pierścienia oraz linii je łączących
* (na podstawie A. Kowalczyk: "Assembler", Wydawnictwo Croma, Wrocław 1999)
*
* @author Rafał Wileczek
*
*/
public class Torus {
public static final Integer[][] torus_wzor = { { 1523, 654757, 0 },
{ 1523, 628221, 90369 }, { 1523, 557041, 152046 },
{ 1523, 463816, 165450 }, { 1523, 378142, 126325 },
{ 1523, 327222, 47092 }, { 1523, 327222, -47092 },
{ 1523, 378142, -126325 }, { 1523, 463816, -165450 },
{ 1523, 557041, -152046 }, { 1523, 628221, -90369 },
{ 160263, 634703, 0 }, { 153663, 609001, 90369 },
{ 135962, 540057, 152046 }, { 112777, 449760, 165450 },
{ 91471, 366778, 126325 }, { 78808, 317459, 47092 },
{ 78808, 317459, -47092 }, { 91471, 366778, -126325 },
{ 112777, 449762, -165450 }, { 135962, 540057, -152046 },
{ 153663, 609001, -90369 }, { 309028, 575802, 0 },
{ 296245, 552550, 90369 }, { 261953, 490174, 152046 },
{ 217042, 408479, 165450 }, { 175769, 333404, 126325 },
{ 151237, 288782, 47092 }, { 151237, 288782, -47092 },
{ 175769, 333404, -126325 }, { 217042, 408480, -165450 },
{ 261953, 490174, -152046 }, { 296245, 552550, -90369 },
{ 438471, 481756, 0 }, { 420308, 462413, 90369 },
{ 371582, 410525, 152046 }, { 307765, 342566, 165450 },
{ 249117, 280113, 126325 }, { 214260, 242994, 47092 },
{ 214260, 242994, -47092 }, { 249117, 280113, -126325 },
{ 307765, 342566, -165450 }, { 371582, 410525, -152046 },
{ 420308, 462413, -90369 }, { 540462, 358473, 0 },
{ 518057, 344254, 90369 }, { 457957, 306115, 152046 },
{ 379245, 256162, 165450 }, { 306908, 210255, 126325 },
{ 263915, 182971, 47092 }, { 263915, 182971, -47092 },
{ 306908, 210255, -126325 }, { 379245, 256162, -165450 },
{ 457957, 306115, -152046 }, { 518057, 344254, -90369 },
{ 608586, 213699, 0 }, { 583350, 205499, 90369 },
{ 515655, 183504, 152046 }, { 426991, 154694, 165450 },
{ 345510, 128221, 126325 }, { 297082, 112485, 47092 },
{ 297082, 112485, -47092 }, { 345510, 128221, -126325 },
{ 426991, 154694, -165450 }, { 515655, 183504, -152046 },
{ 583350, 205499, -90369 }, { 638568, 56531, 0 },
{ 612084, 54865, 90369 }, { 541045, 50395, 152046 },
{ 448004, 44543, 165450 }, { 362499, 39162, 126325 },
{ 311681, 35966, 47092 }, { 311681, 35966, -47092 },
{ 362499, 39162, -126325 }, { 448004, 44543, -165450 },
{ 541045, 50395, -152046 }, { 612084, 54865, -90369 },
{ 628521, -103153, 0 }, { 602456, -98182, 90369 },
{ 532537, -84844, 152046 }, { 440962, -67375, 165450 },
{ 356807, -51321, 126325 }, { 306788, -41780, 47092 },
{ 306788, -41780, -47092 }, { 356807, -51321, -126325 },
{ 440962, -67375, -165450 }, { 532537, -84844, -152046 },
{ 602456, -98182, -90369 }, { 579077, -255324, 0 },
{ 555068, -244026, 90369 }, { 490663, -213719, 152046 },
{ 406310, -174025, 165450 }, { 328790, -137548, 126325 },
{ 282715, -115867, 47092 }, { 282717, -115867, -47092 },
{ 328790, -137548, -126325 }, { 406310, -174025, -165450 },
{ 490663, -213719, -152046 }, { 555068, -244026, -90369 },
{ 493345, -390419, 0 }, { 472899, -373504, 90369 },
{ 418054, -328132, 152046 }, { 346223, -268709, 165450 },
{ 280210, -214097, 126325 }, { 240975, -181639, 47092 },
{ 240975, -181639, -47092 }, { 280210, -214097, -126325 },
{ 346223, -268709, -165450 }, { 418054, -328132, -152046 },
{ 472899, -373504, -90369 }, { 376709, -499947, 0 },
{ 361111, -478479, 90369 }, { 319273, -420893, 152046 },
{ 264477, -345473, 165450 }, { 214119, -276162, 126325 },
{ 184188, -234966, 47092 }, { 184188, -234966, -47092 },
{ 214119, -276162, -126325 }, { 264477, -345473, -165450 },
{ 319273, -420893, -152046 }, { 361111, -478479, -90369 },
{ 236498, -577028, 0 }, { 226729, -552357, 90369 },
{ 200527, -486175, 152046 }, { 166209, -399495, 165450 },
{ 134669, -319838, 126325 }, { 115924, -272495, 47092 },
{ 115924, -272495, -47092 }, { 134669, -319838, -126325 },
{ 166209, -399495, -165450 }, { 200527, -486175, -152046 },
{ 226729, -552357, -90369 }, { 81523, -616819, 0 },
{ 78197, -590494, 90369 }, { 69276, -519874, 152046 },
{ 57593, -427384, 165450 }, { 46854, -342386, 126325 },
{ 40473, -291867, 47092 }, { 40473, -291867, -47092 },
{ 46854, -342386, -126325 }, { 57593, -427384, -165450 },
{ 69276, -519874, -152046 }, { 78197, -590494, -90369 },
{ -78477, -616819, 0 }, { -75151, -590494, 90369 },
{ -66230, -519874, 152046 }, { -54547, -427384, 165450 },
{ -43809, -342386, 126325 }, { -37427, -291867, 47092 },
{ -37427, -291867, -47092 }, { -43809, -342386, -126325 },
{ -54547, -427384, -165450 }, { -66230, -519874, -152046 },
{ -75151, -590494, -90369 }, { -233452, -577028, 0 },
{ -223684, -552357, 90369 }, { -197481, -486175, 152046 },
{ -163163, -399495, 165450 }, { -131624, -319838, 126325 },
{ -112879, -272495, 47092 }, { -112879, -272495, -47092 },
{ -131624, -319838, -126325 }, { -163163, -399495, -165450 },
{ -197481, -486175, -152046 }, { -223684, -552357, -90369 },
{ -373663, -499946, 0 }, { -358065, -478479, 90369 },
{ -316227, -420893, 152046 }, { -261431, -345473, 165450 },
{ -211073, -276162, 126325 }, { -181143, -234966, 47092 },
{ -181143, -234966, -47092 }, { -211073, -276162, -126325 },
{ -261431, -345473, -165450 }, { -316227, -420893, -152046 },
{ -358065, -478479, -90369 }, { -490299, -390419, 0 },
{ -469853, -373504, 90369 }, { -415008, -328132, 152046 },
{ -343175, -268707, 165450 }, { -277164, -214097, 126325 },
{ -237930, -181639, 47092 }, { -237930, -181639, -47092 },
{ -277164, -214097, -126325 }, { -343175, -268707, -165450 },
{ -415008, -328132, -152046 }, { -469853, -373504, -90369 },
{ -576031, -255324, 0 }, { -552022, -244026, 90369 },
{ -487617, -213719, 152046 }, { -403264, -174025, 165450 },
{ -325745, -137548, 126325 }, { -279669, -115867, 47092 },
{ -279669, -115867, -47092 }, { -325745, -137548, -126325 },
{ -403264, -174025, -165450 }, { -487617, -213719, -152046 },
{ -552022, -244026, -90369 }, { -625475, -103153, 0 },
{ -599410, -98181, 90369 }, { -529491, -84844, 152046 },
{ -437916, -67375, 165450 }, { -353761, -51321, 126325 },
{ -303742, -41780, 47092 }, { -303742, -41780, -47092 },
{ -353761, -51321, -126325 }, { -437916, -67375, -165450 },
{ -529491, -84844, -152046 }, { -599410, -98181, -90369 },
{ -635522, 56531, 0 }, { -609039, 54865, 90369 },
{ -537999, 50395, 152046 }, { -444958, 44543, 165450 },
{ -359453, 39162, 126325 }, { -308633, 35966, 47092 },
{ -308633, 35966, -47092 }, { -359453, 39162, -126325 },
{ -444958, 44543, -165450 }, { -537999, 50395, -152046 },
{ -609039, 54865, -90369 }, { -605541, 213699, 0 },
{ -580304, 205499, 90369 }, { -512607, 183504, 152046 },
{ -423945, 154696, 165450 }, { -342464, 128221, 126325 },
{ -294037, 112485, 47092 }, { -294037, 112485, -47092 },
{ -342464, 128221, -126325 }, { -423945, 154696, -165450 },
{ -512607, 183504, -152046 }, { -580304, 205499, -90369 },
{ -537414, 358473, 0 }, { -515011, 344255, 90369 },
{ -454911, 306115, 152046 }, { -376197, 256162, 165450 },
{ -303862, 210255, 126325 }, { -260869, 182971, 47092 },
{ -260869, 182971, -47092 }, { -303862, 210255, -126325 },
{ -376197, 256162, -165450 }, { -454911, 306115, -152046 },
{ -515011, 344255, -90369 }, { -435426, 481756, 0 },
{ -417262, 462413, 90369 }, { -368536, 410525, 152046 },
{ -304717, 342566, 165450 }, { -246071, 280113, 126325 },
{ -211214, 242994, 47092 }, { -211214, 242994, -47092 },
{ -246071, 280113, -126325 }, { -304717, 342566, -165450 },
{ -368536, 410525, -152046 }, { -417262, 462413, -90369 },
{ -305982, 575802, 0 }, { -293199, 552550, 90369 },
{ -258908, 490174, 152046 }, { -213996, 408480, 165450 },
{ -172721, 333404, 126325 }, { -148191, 288782, 47092 },
{ -148191, 288782, -47092 }, { -172723, 333404, -126325 },
{ -213996, 408480, -165450 }, { -258908, 490174, -152046 },
{ -293199, 552550, -90369 }, { -157215, 634703, 0 },
{ -150618, 609001, 90369 }, { -132915, 540057, 152046 },
{ -109731, 449762, 165450 }, { -88426, 366778, 126325 },
{ -75762, 317459, 47092 }, { -75762, 317459, -47092 },
{ -88426, 366778, -126325 }, { -109731, 449762, -165450 },
{ -132916, 540059, -152046 }, { -150618, 609001, -90369 } };
public static final Integer[][] siatka = { { 12, 11 }, { 11, 0 }, { 0, 1 },
{ 1, 12 }, { 13, 12 }, { 12, 1 }, { 1, 2 }, { 2, 13 }, { 14, 13 },
{ 13, 2 }, { 2, 3 }, { 3, 14 }, { 15, 14 }, { 14, 3 }, { 3, 4 },
{ 4, 15 }, { 16, 15 }, { 15, 4 }, { 4, 5 }, { 5, 16 }, { 17, 16 },
{ 16, 5 }, { 5, 6 }, { 6, 17 }, { 18, 17 }, { 17, 6 }, { 6, 7 },
{ 7, 18 }, { 19, 18 }, { 18, 7 }, { 7, 8 }, { 8, 19 }, { 20, 19 },
{ 19, 8 }, { 8, 9 }, { 9, 20 }, { 21, 20 }, { 20, 9 }, { 9, 10 },
{ 10, 21 }, { 11, 21 }, { 21, 10 }, { 10, 0 }, { 0, 11 },
{ 23, 22 }, { 22, 11 }, { 11, 12 }, { 12, 23 }, { 24, 23 },
{ 23, 12 }, { 12, 13 }, { 13, 24 }, { 25, 24 }, { 24, 13 },
{ 13, 14 }, { 14, 25 }, { 26, 25 }, { 25, 14 }, { 14, 15 },
{ 15, 26 }, { 27, 26 }, { 26, 15 }, { 15, 16 }, { 16, 27 },
{ 28, 27 }, { 27, 16 }, { 16, 17 }, { 17, 28 }, { 29, 28 },
{ 28, 17 }, { 17, 18 }, { 18, 29 }, { 30, 29 }, { 29, 18 },
{ 18, 19 }, { 19, 30 }, { 31, 30 }, { 30, 19 }, { 19, 20 },
{ 20, 31 }, { 32, 31 }, { 31, 20 }, { 20, 21 }, { 21, 32 },
{ 22, 32 }, { 32, 21 }, { 21, 11 }, { 11, 22 }, { 34, 33 },
{ 33, 22 }, { 22, 23 }, { 23, 34 }, { 35, 34 }, { 34, 23 },
{ 23, 24 }, { 24, 35 }, { 36, 35 }, { 35, 24 }, { 24, 25 },
{ 25, 36 }, { 37, 36 }, { 36, 25 }, { 25, 26 }, { 26, 37 },
{ 38, 37 }, { 37, 26 }, { 26, 27 }, { 27, 38 }, { 39, 38 },
{ 38, 27 }, { 27, 28 }, { 28, 39 }, { 40, 39 }, { 39, 28 },
{ 28, 29 }, { 29, 40 }, { 41, 40 }, { 40, 29 }, { 29, 30 },
{ 30, 41 }, { 42, 41 }, { 41, 30 }, { 30, 31 }, { 31, 42 },
{ 43, 42 }, { 42, 31 }, { 31, 32 }, { 32, 43 }, { 33, 43 },
{ 43, 32 }, { 32, 22 }, { 22, 33 }, { 45, 44 }, { 44, 33 },
{ 33, 34 }, { 34, 45 }, { 46, 45 }, { 45, 34 }, { 34, 35 },
{ 35, 46 }, { 47, 46 }, { 46, 35 }, { 35, 36 }, { 36, 47 },
{ 48, 47 }, { 47, 36 }, { 36, 37 }, { 37, 48 }, { 49, 48 },
{ 48, 37 }, { 37, 38 }, { 38, 49 }, { 50, 49 }, { 49, 38 },
{ 38, 39 }, { 39, 50 }, { 51, 50 }, { 50, 39 }, { 39, 40 },
{ 40, 51 }, { 52, 51 }, { 51, 40 }, { 40, 41 }, { 41, 52 },
{ 53, 52 }, { 52, 41 }, { 41, 42 }, { 42, 53 }, { 54, 53 },
{ 53, 42 }, { 42, 43 }, { 43, 54 }, { 44, 54 }, { 54, 43 },
{ 43, 33 }, { 33, 44 }, { 56, 55 }, { 55, 44 }, { 44, 45 },
{ 45, 56 }, { 57, 56 }, { 56, 45 }, { 45, 46 }, { 46, 57 },
{ 58, 57 }, { 57, 46 }, { 46, 47 }, { 47, 58 }, { 59, 58 },
{ 58, 47 }, { 47, 48 }, { 48, 59 }, { 60, 59 }, { 59, 48 },
{ 48, 49 }, { 49, 60 }, { 61, 60 }, { 60, 49 }, { 49, 50 },
{ 50, 61 }, { 62, 61 }, { 61, 50 }, { 50, 51 }, { 51, 62 },
{ 63, 62 }, { 62, 51 }, { 51, 52 }, { 52, 63 }, { 64, 63 },
{ 63, 52 }, { 52, 53 }, { 53, 64 }, { 65, 64 }, { 64, 53 },
{ 53, 54 }, { 54, 65 }, { 55, 65 }, { 65, 54 }, { 54, 44 },
{ 44, 55 }, { 67, 66 }, { 66, 55 }, { 55, 56 }, { 56, 67 },
{ 68, 67 }, { 67, 56 }, { 56, 57 }, { 57, 68 }, { 69, 68 },
{ 68, 57 }, { 57, 58 }, { 58, 69 }, { 70, 69 }, { 69, 58 },
{ 58, 59 }, { 59, 70 }, { 71, 70 }, { 70, 59 }, { 59, 60 },
{ 60, 71 }, { 72, 71 }, { 71, 60 }, { 60, 61 }, { 61, 72 },
{ 73, 72 }, { 72, 61 }, { 61, 62 }, { 62, 73 }, { 74, 73 },
{ 73, 62 }, { 62, 63 }, { 63, 74 }, { 75, 74 }, { 74, 63 },
{ 63, 64 }, { 64, 75 }, { 76, 75 }, { 75, 64 }, { 64, 65 },
{ 65, 76 }, { 66, 76 }, { 76, 65 }, { 65, 55 }, { 55, 66 },
{ 78, 77 }, { 77, 66 }, { 66, 67 }, { 67, 78 }, { 79, 78 },
{ 78, 67 }, { 67, 68 }, { 68, 79 }, { 80, 79 }, { 79, 68 },
{ 68, 69 }, { 69, 80 }, { 81, 80 }, { 80, 69 }, { 69, 70 },
{ 70, 81 }, { 82, 81 }, { 81, 70 }, { 70, 71 }, { 71, 82 },
{ 83, 82 }, { 82, 71 }, { 71, 72 }, { 72, 83 }, { 84, 83 },
{ 83, 72 }, { 72, 73 }, { 73, 84 }, { 85, 84 }, { 84, 73 },
{ 73, 74 }, { 74, 85 }, { 86, 85 }, { 85, 74 }, { 74, 75 },
{ 75, 86 }, { 87, 86 }, { 86, 75 }, { 75, 76 }, { 76, 87 },
{ 77, 87 }, { 87, 76 }, { 76, 66 }, { 66, 77 }, { 89, 88 },
{ 88, 77 }, { 77, 78 }, { 78, 89 }, { 90, 89 }, { 89, 78 },
{ 78, 79 }, { 79, 90 }, { 91, 90 }, { 90, 79 }, { 79, 80 },
{ 80, 91 }, { 92, 91 }, { 91, 80 }, { 80, 81 }, { 81, 92 },
{ 93, 92 }, { 92, 81 }, { 81, 82 }, { 82, 93 }, { 94, 93 },
{ 93, 82 }, { 82, 83 }, { 83, 94 }, { 95, 94 }, { 94, 83 },
{ 83, 84 }, { 84, 95 }, { 96, 95 }, { 95, 84 }, { 84, 85 },
{ 85, 96 }, { 97, 96 }, { 96, 85 }, { 85, 86 }, { 86, 97 },
{ 98, 97 }, { 97, 86 }, { 86, 87 }, { 87, 98 }, { 88, 98 },
{ 98, 87 }, { 87, 77 }, { 77, 88 }, { 100, 99 }, { 99, 88 },
{ 88, 89 }, { 89, 100 }, { 101, 100 }, { 100, 89 }, { 89, 90 },
{ 90, 101 }, { 102, 101 }, { 101, 90 }, { 90, 91 }, { 91, 102 },
{ 103, 102 }, { 102, 91 }, { 91, 92 }, { 92, 103 }, { 104, 103 },
{ 103, 92 }, { 92, 93 }, { 93, 104 }, { 105, 104 }, { 104, 93 },
{ 93, 94 }, { 94, 105 }, { 106, 105 }, { 105, 94 }, { 94, 95 },
{ 95, 106 }, { 107, 106 }, { 106, 95 }, { 95, 96 }, { 96, 107 },
{ 108, 107 }, { 107, 96 }, { 96, 97 }, { 97, 108 }, { 109, 108 },
{ 108, 97 }, { 97, 98 }, { 98, 109 }, { 99, 109 }, { 109, 98 },
{ 98, 88 }, { 88, 99 }, { 111, 110 }, { 110, 99 }, { 99, 100 },
{ 100, 111 }, { 112, 111 }, { 111, 100 }, { 100, 101 },
{ 101, 112 }, { 113, 112 }, { 112, 101 }, { 101, 102 },
{ 102, 113 }, { 114, 113 }, { 113, 102 }, { 102, 103 },
{ 103, 114 }, { 115, 114 }, { 114, 103 }, { 103, 104 },
{ 104, 115 }, { 116, 115 }, { 115, 104 }, { 104, 105 },
{ 105, 116 }, { 117, 116 }, { 116, 105 }, { 105, 106 },
{ 106, 117 }, { 118, 117 }, { 117, 106 }, { 106, 107 },
{ 107, 118 }, { 119, 118 }, { 118, 107 }, { 107, 108 },
{ 108, 119 }, { 120, 119 }, { 119, 108 }, { 108, 109 },
{ 109, 120 }, { 110, 120 }, { 120, 109 }, { 109, 99 }, { 99, 110 },
{ 122, 121 }, { 121, 110 }, { 110, 111 }, { 111, 122 },
{ 123, 122 }, { 122, 111 }, { 111, 112 }, { 112, 123 },
{ 124, 123 }, { 123, 112 }, { 112, 113 }, { 113, 124 },
{ 125, 124 }, { 124, 113 }, { 113, 114 }, { 114, 125 },
{ 126, 125 }, { 125, 114 }, { 114, 115 }, { 115, 126 },
{ 127, 126 }, { 126, 115 }, { 115, 116 }, { 116, 127 },
{ 128, 127 }, { 127, 116 }, { 116, 117 }, { 117, 128 },
{ 129, 128 }, { 128, 117 }, { 117, 118 }, { 118, 129 },
{ 130, 129 }, { 129, 118 }, { 118, 119 }, { 119, 130 },
{ 131, 130 }, { 130, 119 }, { 119, 120 }, { 120, 131 },
{ 121, 131 }, { 131, 120 }, { 120, 110 }, { 110, 121 },
{ 133, 132 }, { 132, 121 }, { 121, 122 }, { 122, 133 },
{ 134, 133 }, { 133, 122 }, { 122, 123 }, { 123, 134 },
{ 135, 134 }, { 134, 123 }, { 123, 124 }, { 124, 135 },
{ 136, 135 }, { 135, 124 }, { 124, 125 }, { 125, 136 },
{ 137, 136 }, { 136, 125 }, { 125, 126 }, { 126, 137 },
{ 138, 137 }, { 137, 126 }, { 126, 127 }, { 127, 138 },
{ 139, 138 }, { 138, 127 }, { 127, 128 }, { 128, 139 },
{ 140, 139 }, { 139, 128 }, { 128, 129 }, { 129, 140 },
{ 141, 140 }, { 140, 129 }, { 129, 130 }, { 130, 141 },
{ 142, 141 }, { 141, 130 }, { 130, 131 }, { 131, 142 },
{ 132, 142 }, { 142, 131 }, { 131, 121 }, { 121, 132 },
{ 144, 143 }, { 143, 132 }, { 132, 133 }, { 133, 144 },
{ 145, 144 }, { 144, 133 }, { 133, 134 }, { 134, 145 },
{ 146, 145 }, { 145, 134 }, { 134, 135 }, { 135, 146 },
{ 147, 146 }, { 146, 135 }, { 135, 136 }, { 136, 147 },
{ 148, 147 }, { 147, 136 }, { 136, 137 }, { 137, 148 },
{ 149, 148 }, { 148, 137 }, { 137, 138 }, { 138, 149 },
{ 150, 149 }, { 149, 138 }, { 138, 139 }, { 139, 150 },
{ 151, 150 }, { 150, 139 }, { 139, 140 }, { 140, 151 },
{ 152, 151 }, { 151, 140 }, { 140, 141 }, { 141, 152 },
{ 153, 152 }, { 152, 141 }, { 141, 142 }, { 142, 153 },
{ 143, 153 }, { 153, 142 }, { 142, 132 }, { 132, 143 },
{ 155, 154 }, { 154, 143 }, { 143, 144 }, { 144, 155 },
{ 156, 155 }, { 155, 144 }, { 144, 145 }, { 145, 156 },
{ 157, 156 }, { 156, 145 }, { 145, 146 }, { 146, 157 },
{ 158, 157 }, { 157, 146 }, { 146, 147 }, { 147, 158 },
{ 159, 158 }, { 158, 147 }, { 147, 148 }, { 148, 159 },
{ 160, 159 }, { 159, 148 }, { 148, 149 }, { 149, 160 },
{ 161, 160 }, { 160, 149 }, { 149, 150 }, { 150, 161 },
{ 162, 161 }, { 161, 150 }, { 150, 151 }, { 151, 162 },
{ 163, 162 }, { 162, 151 }, { 151, 152 }, { 152, 163 },
{ 164, 163 }, { 163, 152 }, { 152, 153 }, { 153, 164 },
{ 154, 164 }, { 164, 153 }, { 153, 143 }, { 143, 154 },
{ 166, 165 }, { 165, 154 }, { 154, 155 }, { 155, 166 },
{ 167, 166 }, { 166, 155 }, { 155, 156 }, { 156, 167 },
{ 168, 167 }, { 167, 156 }, { 156, 157 }, { 157, 168 },
{ 169, 168 }, { 168, 157 }, { 157, 158 }, { 158, 169 },
{ 170, 169 }, { 169, 158 }, { 158, 159 }, { 159, 170 },
{ 171, 170 }, { 170, 159 }, { 159, 160 }, { 160, 171 },
{ 172, 171 }, { 171, 160 }, { 160, 161 }, { 161, 172 },
{ 173, 172 }, { 172, 161 }, { 161, 162 }, { 162, 173 },
{ 174, 173 }, { 173, 162 }, { 162, 163 }, { 163, 174 },
{ 175, 174 }, { 174, 163 }, { 163, 164 }, { 164, 175 },
{ 165, 175 }, { 175, 164 }, { 164, 154 }, { 154, 165 },
{ 177, 176 }, { 176, 165 }, { 165, 166 }, { 166, 177 },
{ 178, 177 }, { 177, 166 }, { 166, 167 }, { 167, 178 },
{ 179, 178 }, { 178, 167 }, { 167, 168 }, { 168, 179 },
{ 180, 179 }, { 179, 168 }, { 168, 169 }, { 169, 180 },
{ 181, 180 }, { 180, 169 }, { 169, 170 }, { 170, 181 },
{ 182, 181 }, { 181, 170 }, { 170, 171 }, { 171, 182 },
{ 183, 182 }, { 182, 171 }, { 171, 172 }, { 172, 183 },
{ 184, 183 }, { 183, 172 }, { 172, 173 }, { 173, 184 },
{ 185, 184 }, { 184, 173 }, { 173, 174 }, { 174, 185 },
{ 186, 185 }, { 185, 174 }, { 174, 175 }, { 175, 186 },
{ 176, 186 }, { 186, 175 }, { 175, 165 }, { 165, 176 },
{ 188, 187 }, { 187, 176 }, { 176, 177 }, { 177, 188 },
{ 189, 188 }, { 188, 177 }, { 177, 178 }, { 178, 189 },
{ 190, 189 }, { 189, 178 }, { 178, 179 }, { 179, 190 },
{ 191, 190 }, { 190, 179 }, { 179, 180 }, { 180, 191 },
{ 192, 191 }, { 191, 180 }, { 180, 181 }, { 181, 192 },
{ 193, 192 }, { 192, 181 }, { 181, 182 }, { 182, 193 },
{ 194, 193 }, { 193, 182 }, { 182, 183 }, { 183, 194 },
{ 195, 194 }, { 194, 183 }, { 183, 184 }, { 184, 195 },
{ 196, 195 }, { 195, 184 }, { 184, 185 }, { 185, 196 },
{ 197, 196 }, { 196, 185 }, { 185, 186 }, { 186, 197 },
{ 187, 197 }, { 197, 186 }, { 186, 176 }, { 176, 187 },
{ 199, 198 }, { 198, 187 }, { 187, 188 }, { 188, 199 },
{ 200, 199 }, { 199, 188 }, { 188, 189 }, { 189, 200 },
{ 201, 200 }, { 200, 189 }, { 189, 190 }, { 190, 201 },
{ 202, 201 }, { 201, 190 }, { 190, 191 }, { 191, 202 },
{ 203, 202 }, { 202, 191 }, { 191, 192 }, { 192, 203 },
{ 204, 203 }, { 203, 192 }, { 192, 193 }, { 193, 204 },
{ 205, 204 }, { 204, 193 }, { 193, 194 }, { 194, 205 },
{ 206, 205 }, { 205, 194 }, { 194, 195 }, { 195, 206 },
{ 207, 206 }, { 206, 195 }, { 195, 196 }, { 196, 207 },
{ 208, 207 }, { 207, 196 }, { 196, 197 }, { 197, 208 },
{ 198, 208 }, { 208, 197 }, { 197, 187 }, { 187, 198 },
{ 210, 209 }, { 209, 198 }, { 198, 199 }, { 199, 210 },
{ 211, 210 }, { 210, 199 }, { 199, 200 }, { 200, 211 },
{ 212, 211 }, { 211, 200 }, { 200, 201 }, { 201, 212 },
{ 213, 212 }, { 212, 201 }, { 201, 202 }, { 202, 213 },
{ 214, 213 }, { 213, 202 }, { 202, 203 }, { 203, 214 },
{ 215, 214 }, { 214, 203 }, { 203, 204 }, { 204, 215 },
{ 216, 215 }, { 215, 204 }, { 204, 205 }, { 205, 216 },
{ 217, 216 }, { 216, 205 }, { 205, 206 }, { 206, 217 },
{ 218, 217 }, { 217, 206 }, { 206, 207 }, { 207, 218 },
{ 219, 218 }, { 218, 207 }, { 207, 208 }, { 208, 219 },
{ 209, 219 }, { 219, 208 }, { 208, 198 }, { 198, 209 },
{ 221, 220 }, { 220, 209 }, { 209, 210 }, { 210, 221 },
{ 222, 221 }, { 221, 210 }, { 210, 211 }, { 211, 222 },
{ 223, 222 }, { 222, 211 }, { 211, 212 }, { 212, 223 },
{ 224, 223 }, { 223, 212 }, { 212, 213 }, { 213, 224 },
{ 225, 224 }, { 224, 213 }, { 213, 214 }, { 214, 225 },
{ 226, 225 }, { 225, 214 }, { 214, 215 }, { 215, 226 },
{ 227, 226 }, { 226, 215 }, { 215, 216 }, { 216, 227 },
{ 228, 227 }, { 227, 216 }, { 216, 217 }, { 217, 228 },
{ 229, 228 }, { 228, 217 }, { 217, 218 }, { 218, 229 },
{ 230, 229 }, { 229, 218 }, { 218, 219 }, { 219, 230 },
{ 220, 230 }, { 230, 219 }, { 219, 209 }, { 209, 220 },
{ 232, 231 }, { 231, 220 }, { 220, 221 }, { 221, 232 },
{ 233, 232 }, { 232, 221 }, { 221, 222 }, { 222, 233 },
{ 234, 233 }, { 233, 222 }, { 222, 223 }, { 223, 234 },
{ 235, 234 }, { 234, 223 }, { 223, 224 }, { 224, 235 },
{ 236, 235 }, { 235, 224 }, { 224, 225 }, { 225, 236 },
{ 237, 236 }, { 236, 225 }, { 225, 226 }, { 226, 237 },
{ 238, 237 }, { 237, 226 }, { 226, 227 }, { 227, 238 },
{ 239, 238 }, { 238, 227 }, { 227, 228 }, { 228, 239 },
{ 240, 239 }, { 239, 228 }, { 228, 229 }, { 229, 240 },
{ 241, 240 }, { 240, 229 }, { 229, 230 }, { 230, 241 },
{ 231, 241 }, { 241, 230 }, { 230, 220 }, { 220, 231 },
{ 243, 242 }, { 242, 231 }, { 231, 232 }, { 232, 243 },
{ 244, 243 }, { 243, 232 }, { 232, 233 }, { 233, 244 },
{ 245, 244 }, { 244, 233 }, { 233, 234 }, { 234, 245 },
{ 246, 245 }, { 245, 234 }, { 234, 235 }, { 235, 246 },
{ 247, 246 }, { 246, 235 }, { 235, 236 }, { 236, 247 },
{ 248, 247 }, { 247, 236 }, { 236, 237 }, { 237, 248 },
{ 249, 248 }, { 248, 237 }, { 237, 238 }, { 238, 249 },
{ 250, 249 }, { 249, 238 }, { 238, 239 }, { 239, 250 },
{ 251, 250 }, { 250, 239 }, { 239, 240 }, { 240, 251 },
{ 252, 251 }, { 251, 240 }, { 240, 241 }, { 241, 252 },
{ 242, 252 }, { 252, 241 }, { 241, 231 }, { 231, 242 },
{ 254, 253 }, { 253, 242 }, { 242, 243 }, { 243, 254 },
{ 255, 254 }, { 254, 243 }, { 243, 244 }, { 244, 255 },
{ 256, 255 }, { 255, 244 }, { 244, 245 }, { 245, 256 },
{ 257, 256 }, { 256, 245 }, { 245, 246 }, { 246, 257 },
{ 258, 257 }, { 257, 246 }, { 246, 247 }, { 247, 258 },
{ 259, 258 }, { 258, 247 }, { 247, 248 }, { 248, 259 },
{ 260, 259 }, { 259, 248 }, { 248, 249 }, { 249, 260 },
{ 261, 260 }, { 260, 249 }, { 249, 250 }, { 250, 261 },
{ 262, 261 }, { 261, 250 }, { 250, 251 }, { 251, 262 },
{ 263, 262 }, { 262, 251 }, { 251, 252 }, { 252, 263 },
{ 253, 263 }, { 263, 252 }, { 252, 242 }, { 242, 253 },
{ 265, 264 }, { 264, 253 }, { 253, 254 }, { 254, 265 },
{ 266, 265 }, { 265, 254 }, { 254, 255 }, { 255, 266 },
{ 267, 266 }, { 266, 255 }, { 255, 256 }, { 256, 267 },
{ 268, 267 }, { 267, 256 }, { 256, 257 }, { 257, 268 },
{ 269, 268 }, { 268, 257 }, { 257, 258 }, { 258, 269 },
{ 270, 269 }, { 269, 258 }, { 258, 259 }, { 259, 270 },
{ 271, 270 }, { 270, 259 }, { 259, 260 }, { 260, 271 },
{ 272, 271 }, { 271, 260 }, { 260, 261 }, { 261, 272 },
{ 273, 272 }, { 272, 261 }, { 261, 262 }, { 262, 273 },
{ 274, 273 }, { 273, 262 }, { 262, 263 }, { 263, 274 },
{ 264, 274 }, { 274, 263 }, { 263, 253 }, { 253, 264 }, { 1, 0 },
{ 0, 264 }, { 264, 265 }, { 265, 1 }, { 2, 1 }, { 1, 265 },
{ 265, 266 }, { 266, 2 }, { 3, 2 }, { 2, 266 }, { 266, 267 },
{ 267, 3 }, { 4, 3 }, { 3, 267 }, { 267, 268 }, { 268, 4 },
{ 5, 4 }, { 4, 268 }, { 268, 269 }, { 269, 5 }, { 6, 5 },
{ 5, 269 }, { 269, 270 }, { 270, 6 }, { 7, 6 }, { 6, 270 },
{ 270, 271 }, { 271, 7 }, { 8, 7 }, { 7, 271 }, { 271, 272 },
{ 272, 8 }, { 9, 8 }, { 8, 272 }, { 272, 273 }, { 273, 9 },
{ 10, 9 }, { 9, 273 }, { 273, 274 }, { 274, 10 }, { 0, 10 },
{ 10, 274 }, { 274, 264 }, { 264, 0 } };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.