Calculating Geometry Documents 2

Source: Internet
Author: User
Tags polyline

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.