国内精品人妻无码久久久影院,亚洲国产成人久久综合区,免费国产99久久久香蕉http://m.shnenglu.com/Wangzhihao/category/15609.html為了自己的夢想,每天要像小樂一樣勤奮!zh-cnMon, 03 Jan 2011 21:12:13 GMTMon, 03 Jan 2011 21:12:13 GMT601444 Parallelepiped walkhttp://m.shnenglu.com/Wangzhihao/articles/120959.html王之昊王之昊Wed, 21 Jul 2010 06:29:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/120959.htmlhttp://m.shnenglu.com/Wangzhihao/comments/120959.htmlhttp://m.shnenglu.com/Wangzhihao/articles/120959.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/120959.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/120959.html

1444 Parallelepiped walk

       做法一可以嘗試分類討論。具體類似這道題目The Return of Carl。然后也可以觀察分類討論的幾種情況。如下圖:

可以發(fā)現(xiàn)他們沿x軸一個方向走,沿y軸也是一個方向走,不會來回。(這點(diǎn)很重要,如果不發(fā)現(xiàn)這一點(diǎn)直接搜的話,會搜出更短的但不合法的距離。) 也可以判是否路線經(jīng)過了所有的矩形,如果經(jīng)過了,就是一條合法路徑。

 



王之昊 2010-07-21 14:29 發(fā)表評論
]]>
Cover an Archttp://m.shnenglu.com/Wangzhihao/articles/119376.html王之昊王之昊Mon, 05 Jul 2010 12:19:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/119376.htmlhttp://m.shnenglu.com/Wangzhihao/comments/119376.htmlhttp://m.shnenglu.com/Wangzhihao/articles/119376.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/119376.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/119376.htmlCover an Arc

       寫好計(jì)算幾何很多時候要養(yǎng)成一個好習(xí)慣。
      
       比如求比浮點(diǎn)數(shù) f 小的最小的整數(shù),認(rèn)為絕對值差在1e-9的精度內(nèi)兩個浮點(diǎn)數(shù)是相同的,首先是看 f 是否就是一個整數(shù), 是則返回 f 。 否則返回 f 的截?cái)唷?這時如果直接用 floor( f ),很容易忽視這種情況 如0.9,999,999,999。它和 1 在1e-9精度下是相等的。所以答案應(yīng)該是1, 而floor(f) = 0;

       又如Reflections 這道題中的反射,大致是光線從一點(diǎn)射出,射到某個球上,再反射,再射下一個球上,重復(fù),直到不再與球相交。
      
       我們假設(shè)前一次反射的球?yàn)閎ase,再求下一個射到的球的位置時,就不該考慮base,他一定不是我們要求的那個下一個球,但如果不先排除base,我們很容易就算到base是下一個射到的球這樣一個錯誤的答案,這樣模棱兩可的情況如果能在邏輯上排除,盡量排除。
       
        在這些精度問題上要注意小心,更好的辦法就是平時寫的時候養(yǎng)成一個好習(xí)慣。

        能邏輯上排除的就不進(jìn)行浮點(diǎn)數(shù)比較,能避免就避免。如果不能避免,一定要加上符號判斷函數(shù)
        int D(double x ){ return x < -eps ? -1 : x > eps; }


王之昊 2010-07-05 20:19 發(fā)表評論
]]>
2284 That Nice Euler Circuithttp://m.shnenglu.com/Wangzhihao/articles/110299.html王之昊王之昊Mon, 22 Mar 2010 08:25:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/110299.htmlhttp://m.shnenglu.com/Wangzhihao/comments/110299.htmlhttp://m.shnenglu.com/Wangzhihao/articles/110299.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/110299.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/110299.html

王之昊 2010-03-22 16:25 發(fā)表評論
]]>
3329 Twirl Aroundhttp://m.shnenglu.com/Wangzhihao/articles/110187.html王之昊王之昊Sat, 20 Mar 2010 16:36:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/110187.htmlhttp://m.shnenglu.com/Wangzhihao/comments/110187.htmlhttp://m.shnenglu.com/Wangzhihao/articles/110187.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/110187.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/110187.html 

出題者應(yīng)該會避免相切的數(shù)據(jù)。和當(dāng)前木棍在同一直線上的特殊點(diǎn),一種可以根據(jù)線段的中心確定它會不會阻擋。

 

 另外一種連中心也在同一條直線上。這時認(rèn)為在有木棍實(shí)體的那側(cè)的特殊點(diǎn)不會阻擋,而另一側(cè)會。

 

 

總的來說,障礙物(一條線段)他可能出現(xiàn)的位置是0~360。而難區(qū)分的是0度和360度。如果發(fā)現(xiàn)一個點(diǎn)落在0度或360度的位置時,通過判斷障礙物在左邊(包括平行的時候)還是在右邊來確定會不會阻擋。

還可以通過讓木棍轉(zhuǎn)動一個小的角度,看一下是遠(yuǎn)離障礙物,還是和障礙物相交來確定是否會阻擋。



王之昊 2010-03-21 00:36 發(fā)表評論
]]>
3525 Most Distant Point from the Seahttp://m.shnenglu.com/Wangzhihao/articles/109785.html王之昊王之昊Mon, 15 Mar 2010 15:12:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/109785.htmlhttp://m.shnenglu.com/Wangzhihao/comments/109785.htmlhttp://m.shnenglu.com/Wangzhihao/articles/109785.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/109785.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/109785.html還有一種做法就是內(nèi)切圓必然和多邊形的某些邊相切, 我們二分半徑, 然后枚舉兩條相切的邊(凹多邊形也可能是頂點(diǎn)), 確定圓心, 再看多邊形是否包含這個圓.
確定圓心的時候直接解方程就可以了.



王之昊 2010-03-15 23:12 發(fā)表評論
]]>
3608 Bridge Across Islandshttp://m.shnenglu.com/Wangzhihao/articles/109777.html王之昊王之昊Mon, 15 Mar 2010 14:56:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/109777.htmlhttp://m.shnenglu.com/Wangzhihao/comments/109777.htmlhttp://m.shnenglu.com/Wangzhihao/articles/109777.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/109777.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/109777.html當(dāng)遇到這種精度卡的很緊的題目時,要盡量少用角度.



王之昊 2010-03-15 22:56 發(fā)表評論
]]>
3675 Telescopehttp://m.shnenglu.com/Wangzhihao/articles/109773.html王之昊王之昊Mon, 15 Mar 2010 14:48:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/109773.htmlhttp://m.shnenglu.com/Wangzhihao/comments/109773.htmlhttp://m.shnenglu.com/Wangzhihao/articles/109773.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/109773.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/109773.html對于每種情況.實(shí)際上只要算出圓和線段的相交區(qū)域的端點(diǎn)即可.





王之昊 2010-03-15 22:48 發(fā)表評論
]]>
2932 Coneologyhttp://m.shnenglu.com/Wangzhihao/articles/109348.html王之昊王之昊Wed, 10 Mar 2010 05:05:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/109348.htmlhttp://m.shnenglu.com/Wangzhihao/comments/109348.htmlhttp://m.shnenglu.com/Wangzhihao/articles/109348.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/109348.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/109348.html閱讀全文

王之昊 2010-03-10 13:05 發(fā)表評論
]]>
3410 Split convex polygonhttp://m.shnenglu.com/Wangzhihao/articles/108911.html王之昊王之昊Thu, 04 Mar 2010 15:39:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/108911.htmlhttp://m.shnenglu.com/Wangzhihao/comments/108911.htmlhttp://m.shnenglu.com/Wangzhihao/articles/108911.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/108911.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/108911.html    首先判斷兩個多邊形的凹凸性, 如果兩個多邊形都是凸的.那么兩個凸多邊形只會公共一條邊,需要檢查兩端的凹凸性.
 如果有凹多邊形,那么凹點(diǎn)必定是要和別人耦合的,可以先找一個凹點(diǎn),再枚舉另一個多邊形的所有點(diǎn),看是否和該凹點(diǎn)匹配,如果匹配,就沿著多邊形的方向走,繼續(xù)檢查下一對點(diǎn), 下一對點(diǎn)要么耦合, 要么以一個凸的形狀分開.


最后只要檢查所有的凹點(diǎn)是否都訪問了就可以了.


王之昊 2010-03-04 23:39 發(fā)表評論
]]>
3384 Feng Shuihttp://m.shnenglu.com/Wangzhihao/articles/108797.html王之昊王之昊Wed, 03 Mar 2010 07:44:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/108797.htmlhttp://m.shnenglu.com/Wangzhihao/comments/108797.htmlhttp://m.shnenglu.com/Wangzhihao/articles/108797.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/108797.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/108797.html    就是求凸多邊形的核,再求核上的最遠(yuǎn)點(diǎn)。


王之昊 2010-03-03 15:44 發(fā)表評論
]]>
3347 Kadj Squareshttp://m.shnenglu.com/Wangzhihao/articles/108795.html王之昊王之昊Wed, 03 Mar 2010 07:29:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/108795.htmlhttp://m.shnenglu.com/Wangzhihao/comments/108795.htmlhttp://m.shnenglu.com/Wangzhihao/articles/108795.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/108795.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/108795.html    如果能確定每個正方形的位置。那么就可以很輕松的算出遮擋關(guān)系。這可以轉(zhuǎn)換成一些區(qū)間的覆蓋問題。
    如果確定了1,2,...,k-1的位置,現(xiàn)在要確定第 k 個的位置。假設(shè)有兩個正方形a,b。a的位置已經(jīng)確定為 Xa,b在a的右邊,那么 Xb = Xa + min(a, b)*sqrt(2);這樣就可以確定第k塊正方形的位置了。
    注意到上面涉及浮點(diǎn)數(shù),我們把邊長擴(kuò)大根號二倍,不影響最后結(jié)果,但只有整數(shù)間的運(yùn)算。


王之昊 2010-03-03 15:29 發(fā)表評論
]]>
3336 ACM Undergroundhttp://m.shnenglu.com/Wangzhihao/articles/108789.html王之昊王之昊Wed, 03 Mar 2010 07:00:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/108789.htmlhttp://m.shnenglu.com/Wangzhihao/comments/108789.htmlhttp://m.shnenglu.com/Wangzhihao/articles/108789.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/108789.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/108789.html閱讀全文

王之昊 2010-03-03 15:00 發(fā)表評論
]]>
3521 Geometric Maphttp://m.shnenglu.com/Wangzhihao/articles/108568.html王之昊王之昊Sat, 27 Feb 2010 11:03:00 GMThttp://m.shnenglu.com/Wangzhihao/articles/108568.htmlhttp://m.shnenglu.com/Wangzhihao/comments/108568.htmlhttp://m.shnenglu.com/Wangzhihao/articles/108568.html#Feedback0http://m.shnenglu.com/Wangzhihao/comments/commentRss/108568.htmlhttp://m.shnenglu.com/Wangzhihao/services/trackbacks/108568.html閱讀全文

王之昊 2010-02-27 19:03 發(fā)表評論
]]>
亚洲国产成人久久笫一页| 国产综合久久久久| 久久人搡人人玩人妻精品首页| 精品欧美一区二区三区久久久| 久久99精品免费一区二区| 久久久久久国产a免费观看黄色大片 | 伊人久久国产免费观看视频 | 久久综合久久鬼色| 东方aⅴ免费观看久久av | 欧洲性大片xxxxx久久久| 亚洲成色WWW久久网站| 国产午夜精品久久久久九九| 囯产极品美女高潮无套久久久| 久久免费视频网站| 色综合久久久久久久久五月| 99久久亚洲综合精品网站| 亚洲香蕉网久久综合影视| 久久久久噜噜噜亚洲熟女综合| 久久99精品国产自在现线小黄鸭| 久久这里只有精品视频99| 国产福利电影一区二区三区久久老子无码午夜伦不 | 精品久久人人做人人爽综合| 久久亚洲AV成人无码电影| 亚洲天堂久久久| 国产精品成人无码久久久久久 | 久久精品a亚洲国产v高清不卡| 香港aa三级久久三级老师2021国产三级精品三级在 | 久久精品九九亚洲精品天堂 | 精品久久久久久无码国产| 97久久天天综合色天天综合色hd| 亚洲日韩欧美一区久久久久我 | 久久影视综合亚洲| 久久精品18| 国内精品久久久久影院网站| 97久久超碰成人精品网站| 久久婷婷五月综合97色一本一本| 久久久www免费人成精品| | 久久国产AVJUST麻豆| 性欧美大战久久久久久久 | 国产精品99久久不卡|