http://www.scriptol.com/programming/graphic-algorithms.php http://www.kuqin.com/algorithm/20110813/105152.html