I'm trying to make a program that draws a Koch fractal. Is there any way I can draw a line in Java by length instead of coordinates?
A koch fractal looks kind of like a snowflake. The repeating pattern is equilateral triangles inserted 1/3 of the way into each line (with the triangle's sides being 1/3 the length of the line).
Originally I was trying to draw triangles recursively, but I couldn't figure out how to calculate the coordinates. Then I thought it would be way easier if I could just draw lines of a certain length and rotate them, and reduce the length of the lines each time. Except that I don't know if I even can draw lines by length in Java. I have tried searching the internet for this and have not found an answer, which makes me think it's not possible, but I thought I would ask here just to make sure.
I realize this is way beyond my technical college level. I also realize I could probably find a complete program that someone else has already written, but I want to see if I can figure it out (mostly) on my own.