|
1 | 1 | package dev.felnull; |
2 | 2 |
|
3 | | -import dev.felnull.fnjl.util.FNMath; |
4 | | - |
5 | | -import javax.imageio.ImageIO; |
6 | | -import java.awt.*; |
7 | | -import java.awt.image.BufferedImage; |
8 | | -import java.nio.file.Paths; |
| 3 | +import dev.felnull.fnjl.math.FNVec2i; |
9 | 4 |
|
10 | 5 | public class TestMain { |
11 | 6 | public static void main(String[] args) throws Exception { |
12 | | - ImageIO.write(generateMandelbrotCL(500, 500, 0, 0, 1), "png", Paths.get("test\\test.png").toFile()); |
13 | | - } |
14 | | - |
15 | | - public static BufferedImage generateMandelbrot(int width, int height, double posX, double posY, double zoom) { |
16 | | - BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); |
17 | | - FNMath.generateMandelbrotSet(width, height, posX, posY, zoom, 20, n -> { |
18 | | - image.setRGB(n.getX(), n.getY(), 0xFFFFFF); |
19 | | - }); |
20 | | - return image; |
21 | | - } |
22 | | - |
23 | | - public static BufferedImage generateMandelbrotCL(int width, int height, double posX, double posY, double zoom) { |
24 | | - BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); |
25 | | - FNMath.generateColorMandelbrot(width, height, posX, posY, zoom, 10, n -> { |
26 | | - image.setRGB(n.getPos().getX(), n.getPos().getY(), Color.HSBtoRGB((float) n.getColor() / 10, 1, 1)); |
27 | | - }); |
28 | | - return image; |
| 7 | + System.out.println(new FNVec2i(0, 0).distance(new FNVec2i(1, 1))); |
29 | 8 | } |
30 | 9 | } |
0 commit comments