|
--从任意一个点出发,能够连接的点
with a as(
select sqrt(2)/2 a , 1 b from dual),
t as(select level-1 l from dual connect by level<=3),
x as(select a*p.l+b*p2.l p from a,t p,t p2
where a*p.l+b*p2.l <=sqrt(2)+1),
p as(select x.p x,y.p y from x,x y),
b as(select rownum rn,x,y from p
where
power(x-(sqrt(2)+1)/2,2)+power(y-(sqrt(2)+1)/2,2)
<=
power(sqrt(2)/2-(sqrt(2)+1)/2,2)+power(0-(sqrt(2)+1)/2,2)
),
c(x0,y0,n,pa,lv)
as(select x,y,rn,power(2,rn),1 from b --where x=sqrt(2)/2 and y=0
union all
select x,y,rn,pa+power(2,rn),lv+1 from b,c where
power(x-x0,2)+power(y-y0,2)=1 and lv<=1)
select distinct pa from c where lv=2
;
PA
-------------
1048592
2148532224
12582912
17184063488
1099545182208
279172874240
4194308
206158430208
66
3072
12288
393216
17180000256
68720525312
50331648
260
96
8320
1073742336
786432
12884901888
566935683072
131076
275146342400
6442450944
2267742732288
1040
16640
268437504
1133871366144
520
192
4160
33280
66560
1610612736
100663296
已选择37行。 |
|