Move forward the previous question . I have two rectangles and they look like this:
struct Rect { NSPoint topLeft; NSPoint topRight; NSPoint bottomLeft; NSPoint bottomRight; }
I use something like this to check if rectangles (or collision) intersect. If two rectangles intersect, I want to calculate the intersection area in the first rectangle or the point where the second rectangle intersects with the first rectangle (i.e., the intersection coordinates).
How to calculate intersecting points or an intersection area.
You can determine the intersection points by doing the following:
foreach line in rectangle 1: line1 foreach line in rectangle 2: line2 find point of intersection for line1, line2
:
http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/
, , , , / . 8 3 ( ).
, , , :)
, , , " ". ( ).
, :
http://www.cs.man.ac.uk/aig/staff/alan/software/
, ( - ). , , , .
, , SO:
?
Source: https://habr.com/ru/post/1759830/More articles:using different site.master files for themes - c #C getopt - - ciPhone memory management with viewDidUnload - objective-cDoes python have a ruby ββinstaller like gem that allows you to install modules from the command line even if they are not on your machine? - pythonCan I use any Android phone for application development? - androidProblem with GROUP BY CASE - sqlRotated 2d Rectangle Intersection Detection - c ++Are there any math libraries for F #? - mathint release in objective-c - objective-cQT / WebKit GUI transfers selected HTML element data to Qt application - qtAll Articles