b'\n_START_ARTICLE_\nHilbertova krivulja\n_START_PARAGRAPH_\nHilbertova kriv\xc3\xbalja [h\xc3\xadlbertova ~] je zvezna fraktalna krivulja, ki zapolni prostor. Prvi jo je opisal David Hilbert leta 1891 kot varianto krivulj, ki zapolnijo prostor, ki jih je odkril Giuseppe Peano leta 1890._NEWLINE_Njena Hausdorffova razse\xc5\xbenost je 2. Evklidska dol\xc5\xbeina  H_n  je  2^n - {1 \\over 2^n} , tj. nara\xc5\xa1\xc4\x8da eksponentno z  n . <br="clearall">\n_START_SECTION_\nRa\xc4\x8dunalni\xc5\xa1ki program\n_START_PARAGRAPH_\nSpodnji Java applet nari\xc5\xa1e Hilbertovo krivuljo z rekurzivno metodo:_NEWLINE_import java.awt.*;_NEWLINE_import java.applet.*;_NEWLINE__NEWLINE_public class HilbertCurve extends Applet {_NEWLINE_    private SimpleGraphics sg=null;_NEWLINE_    private int dist0=512, dist=dist0;_NEWLINE__NEWLINE_    public void init() {_NEWLINE_        sg = new SimpleGraphics(getGraphics());_NEWLINE_        dist0 = 512;_NEWLINE_        resize ( dist0, dist0 );_NEWLINE_    }_NEWLINE__NEWLINE_    public void paint(Graphics g) {_NEWLINE_        int level=4;_NEWLINE_        dist=dist0;_NEWLINE_        for (int i=level;i>0;i--) dist /= 2;_NEWLINE_        sg.goToXY ( dist/2, dist/2 );_NEWLINE_        HilbertA(level); // start recursion_NEWLINE_    }_NEWLINE__NEWLINE_    private void HilbertA (int level) {_NEWLINE_        if (level > 0) {_NEWLINE_            HilbertB(level-1);    sg.lineRel(0,dist);_NEWLINE_            HilbertA(level-1);    sg.lineRel(dist,0);_NEWLINE_            HilbertA(level-1);    sg.lineRel(0,-dist);_NEWLINE_            HilbertC(level-1);_NEWLINE_        }_NEWLINE_    }_NEWLINE__NEWLINE_    private void HilbertB (int level) {_NEWLINE_        if (level > 0) {_NEWLINE_            HilbertA(level-1);    sg.lineRel(dist,0);_NEWLINE_            HilbertB(level-1);    sg.lineRel(0,dist);_NEWLINE_            HilbertB(level-1);    sg.lineRel(-dist,0);_NEWLINE_            HilbertD(level-1);_NEWLINE_        }_NEWLINE_    }_NEWLINE__NEWLINE_    private void HilbertC (int level) {_NEWLINE_        if (level > 0) {_NEWLINE_            HilbertD(level-1);    sg.lineRel(-dist,0);_NEWLINE_            HilbertC(level-1);    sg.lineRel(0,-dist);_NEWLINE_            HilbertC(level-1);    sg.lineRel(dist,0);_NEWLINE_            HilbertA(level-1);_NEWLINE_        }_NEWLINE_    }_NEWLINE__NEWLINE_    private void HilbertD (int level) {_NEWLINE_        if (level > 0) {_NEWLINE_            HilbertC(level-1);    sg.lineRel(0,-dist);_NEWLINE_            HilbertD(level-1);    sg.lineRel(-dist,0);_NEWLINE_            HilbertD(level-1);    sg.lineRel(0,dist);_NEWLINE_            HilbertB(level-1);_NEWLINE_        }_NEWLINE_    }_NEWLINE_}_NEWLINE__NEWLINE_class SimpleGraphics {_NEWLINE_    private Graphics g = null;_NEWLINE_    private int x = 0, y = 0;    _NEWLINE__NEWLINE_    public SimpleGraphics(Graphics g) { this.g = g; }_NEWLINE_    public void goToXY(int x, int y) { this.x = x;   this.y = y; }_NEWLINE__NEWLINE_    public void lineRel(int deltaX, int deltaY) {_NEWLINE_        g.drawLine ( x, y, x+deltaX, y+deltaY );_NEWLINE_        x += deltaX;    y += deltaY;_NEWLINE_    }_NEWLINE_}'