99999久久久久久亚洲,欧美人与禽猛交狂配,高清日韩av在线影院,一个人在线高清免费观看,啦啦啦在线视频免费观看www

熱線電話:13121318867

登錄
首頁(yè)精彩閱讀Hilbert空間遞歸演示?_數(shù)據(jù)分析師
Hilbert空間遞歸演示?_數(shù)據(jù)分析師
2014-12-07
收藏

Hilbert空間遞歸演示_數(shù)據(jù)分析師


Hilbert空間填充曲線在圖像采樣等方面十分有用關(guān)于什么希爾伯特

空間填充曲線看這里:http://en.wikipedia.org/wiki/Hilbert_curve

程序效果:

模擬Hilbert空間填充曲線效果,點(diǎn)擊鼠標(biāo)自動(dòng)疊加!運(yùn)行效果截圖

20140217231252375

Hilbert源程序代碼:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
package com.gloomyfish.image.hilbert;
         
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
         
public class Hilbert {
             
    public static final int WHEELSIZE = 1024;
             
    // four edges
    public static final int NORTH = 0;
    public static final int EAST = 90;
    public static final int SOUTH = 180;
    public static final int WEST = 270;
         
    // four corners
    public static final int NE = 45;
    public static final int SE = 135;
    public static final int SW = 225;
    public static final int NW = 315;
             
    // attributes
    private Point location;
    private Color[] colorWheel;
    private int colorIdx;
         
    public Hilbert() {
        // build color lookup table
        this.colorWheel = new Color[1024];
        for (int i = 0; i < 128; ++i)
            this.colorWheel[i] = new Color(0, 255 - i, i);
        for (int j = 128; j < 256; ++j)
            this.colorWheel[j] = new Color(0, j, j);
        for (int k = 0; k < 256; ++k)
            this.colorWheel[(k + 256)] = new Color(0, 255 - k, 255);
        for (int l = 0; l < 128; ++l)
            this.colorWheel[(l + 512)] = new Color(0, l, 255 - l);
        for (int i1 = 0; i1 < 128; ++i1)
            this.colorWheel[(i1 + 640)] = new Color(0, 127 - i1, 127 - i1);
        for (int i2 = 0; i2 < 256; ++i2)
            this.colorWheel[(i2 + 768)] = new Color(0, i2, 0);
        this.colorIdx = 0;
    }
         
    public void process(Graphics graphic, int level, int width, int height) {
        this.location = null;
        if(level > 32 ) 
        {
            graphic.drawString("could get max depth is 32!", 40, 40);
            return;
        }
        hilbert(graphic, level, 0, 0, width, height, 0, 225);
    }
         
    public void hilbert(Graphics g, int depth, int startx, int starty, int width, int height, int startgray, int endgray) {
        int centerX = width / 2;
        int centerY = height / 2;
        if (depth == 0) {
            if (this.location != null) {
                g.setColor(this.colorWheel[this.colorIdx]);
                g.drawLine(this.location.x, this.location.y,
                        startx + centerX, starty + centerY);
                if (++this.colorIdx >= 1024)
                    this.colorIdx = 0;
            }
            this.location = new Point(startx + centerX, starty + centerY);
            return;
        }
         
        switch (startgray) {

數(shù)據(jù)分析咨詢請(qǐng)掃描二維碼

若不方便掃碼,搜微信號(hào):CDAshujufenxi

數(shù)據(jù)分析師資訊
更多

OK
客服在線
立即咨詢
客服在線
立即咨詢
') } function initGt() { var handler = function (captchaObj) { captchaObj.appendTo('#captcha'); captchaObj.onReady(function () { $("#wait").hide(); }).onSuccess(function(){ $('.getcheckcode').removeClass('dis'); $('.getcheckcode').trigger('click'); }); window.captchaObj = captchaObj; }; $('#captcha').show(); $.ajax({ url: "/login/gtstart?t=" + (new Date()).getTime(), // 加隨機(jī)數(shù)防止緩存 type: "get", dataType: "json", success: function (data) { $('#text').hide(); $('#wait').show(); // 調(diào)用 initGeetest 進(jìn)行初始化 // 參數(shù)1:配置參數(shù) // 參數(shù)2:回調(diào),回調(diào)的第一個(gè)參數(shù)驗(yàn)證碼對(duì)象,之后可以使用它調(diào)用相應(yīng)的接口 initGeetest({ // 以下 4 個(gè)配置參數(shù)為必須,不能缺少 gt: data.gt, challenge: data.challenge, offline: !data.success, // 表示用戶后臺(tái)檢測(cè)極驗(yàn)服務(wù)器是否宕機(jī) new_captcha: data.new_captcha, // 用于宕機(jī)時(shí)表示是新驗(yàn)證碼的宕機(jī) product: "float", // 產(chǎn)品形式,包括:float,popup width: "280px", https: true // 更多配置參數(shù)說(shuō)明請(qǐng)參見:http://docs.geetest.com/install/client/web-front/ }, handler); } }); } function codeCutdown() { if(_wait == 0){ //倒計(jì)時(shí)完成 $(".getcheckcode").removeClass('dis').html("重新獲取"); }else{ $(".getcheckcode").addClass('dis').html("重新獲取("+_wait+"s)"); _wait--; setTimeout(function () { codeCutdown(); },1000); } } function inputValidate(ele,telInput) { var oInput = ele; var inputVal = oInput.val(); var oType = ele.attr('data-type'); var oEtag = $('#etag').val(); var oErr = oInput.closest('.form_box').next('.err_txt'); var empTxt = '請(qǐng)輸入'+oInput.attr('placeholder')+'!'; var errTxt = '請(qǐng)輸入正確的'+oInput.attr('placeholder')+'!'; var pattern; if(inputVal==""){ if(!telInput){ errFun(oErr,empTxt); } return false; }else { switch (oType){ case 'login_mobile': pattern = /^1[3456789]\d{9}$/; if(inputVal.length==11) { $.ajax({ url: '/login/checkmobile', type: "post", dataType: "json", data: { mobile: inputVal, etag: oEtag, page_ur: window.location.href, page_referer: document.referrer }, success: function (data) { } }); } break; case 'login_yzm': pattern = /^\d{6}$/; break; } if(oType=='login_mobile'){ } if(!!validateFun(pattern,inputVal)){ errFun(oErr,'') if(telInput){ $('.getcheckcode').removeClass('dis'); } }else { if(!telInput) { errFun(oErr, errTxt); }else { $('.getcheckcode').addClass('dis'); } return false; } } return true; } function errFun(obj,msg) { obj.html(msg); if(msg==''){ $('.login_submit').removeClass('dis'); }else { $('.login_submit').addClass('dis'); } } function validateFun(pat,val) { return pat.test(val); }