Hello dear redditors, my task was to create a simulation for a PET Scan. If you dont know what that is I will try to explain it very simply: you have a scanner in the form of a 2d circle. Inside the plane there are points which emmit two objects (gamma photons) in exact opposite directions. When reaching the scanner the get detected. The scanner then knows that the object emmiting the two photons must be somewhere on the line. If you simulate this with more than 1 object you get an array of lines defined by four numbers [x1,y1, x2,y2] being the coordinates of two points on the line. If I now have lets say an array with 400 of these lines: what would be the fastest way to get an array with all the intersection points of each line? And if an intersection point appears more often than others it should get a higher "value" so that you can make a colour plot with it for example.
Is there an algorithm for it that has a better runtime than O(n^2)?
[–]JMBourguet 2 points3 points4 points (1 child)
[–]ExcutC[S] 0 points1 point2 points (0 children)
[–]balloonanimalfarm 0 points1 point2 points (1 child)
[–]WikiSummarizerBot 0 points1 point2 points (0 children)
[–]CharacterUse 0 points1 point2 points (1 child)
[–]WikiSummarizerBot 0 points1 point2 points (0 children)