Calculating Geometry Documents 2
Dionysoslai ([email protected]) 2015/1/7
Last April, I wrote the first computational geometry document, http://blog.csdn.net/dionysos_lai/article/details/24418697, and failed to continue writing the second document, On the one hand, some code has not been verified by actual project, dare not publish. Now, the 2014 project is over, the whole code has been a number of game validation tests, basically no problem, so once the code all submitted to Githup, welcome to download, the address is as follows: Https://github.com/DionysosLai/Geometry
Summary of Computational geometry documents:
1. Cross product
2. Determine the turn of the polyline
3. Determine if line and polyline intersect
4. Determine if the point is in the rectangle
5. Determine if the point is on a line segment
6. Find points to the nearest point of the segment
7. Determine if two rectangles intersect
8. Determine if the point is within the polygon (including points on the polygon line)
9. Determine if the point is within the circle
10. Determine if the segment intersects the segment
11. Get the angle value between two points (0 to 360)
12. Determine if the segment intersects the circle
13. Determine if two circles intersect
14. Determine if two rectangles intersect
15. Determine if the segment is within a polygon
16. Calculate the intersection point of two collinear line segments
17. Calculate the intersection of two segments
18. Calculate the intersection of a segment and a circle
19. Calculating the convex hull of a point set
Basically, the approximate geometric algorithm is implemented, there are some problems, such as determining whether the polyline intersects with the circle, you can simplify the polyline to a number of lines, that is, the implementation of the 12th article.
At present, in reading some geometry books, will be added some geometric algorithms come out, while the current code implementation is based on cocos2dx2.3 implementation, over a period of time will be the code to the common implementation. The code can be downloaded from the Githup URL: https://github.com/DionysosLai/Geometry.
Ok, I hope this geometry document is useful for everyone.
Calculating Geometry Documents 2