Midterm: Additional notes
October 22nd, 2008On drawing pictures:
- Here’s a sample latex source file (and the picture used). Note that you MUST compile the source using pdflatex rather than latex. You can also use .pdf or .jpg files (just change the filename in the source)
- For drawing pictures, you can use
- Ipe, which integrates with LaTeX and generates PS or PDF
- Xfig, which exports all kinds of formats (X-windows based)
- Inkscape, which is an open source variant of Illustrator
- Powerpoint (exports jpg)
- Paint (exports jpg)
- Or any program you like, and then use ‘convert’ on the CADE machines to convert it. For example, convert foo.bmp foo.jpg
If you’re pressed for time, Powerpoint is the easiest solution. Long-term, Ipe and Inkscape are the best free solutions for drawing, and Ipe is the best if you have complicated LaTeX in the figure. Inkscape gives prettier pics though. My flow diagram was drawn in Ipe, but the range searching pic was drawn in Inkscape.
On assumptions for Q2:
- You can assume that operations involving a constant number of points and lines (do two lines intersect, and what is their intersection ? are two lines parallel ? What side of the line does this point lie on ? etc) can be performed in constant time, and you don’t need to specify how exactly this is done. If in doubt, post a comment and I’ll tell you if it’s ok to assume it.
October 24th, 2008 at 1:13 pm
On Q2.1 & 2.2, it seems impossible that a line L can intersect three quadrants AND that any one of those three quadrants be “completely contained on one side of L”, at least as was demonstrated in class on Wednesday. If line L is intersecting a quadrant, it is not completely contained on one side of the line, by definition, unless I suppose if its touching and edge of the quadrant. So I don’t quite understand the question.
October 24th, 2008 at 1:37 pm
No no. The claim is that
* any line intersects at most three quadrants
* at least one of the *four* quadrants is completely contained on one side of L
October 24th, 2008 at 7:01 pm
So when 2.2 is using v1 as an example of being completely contained on one side of L, it is not referring to the v1 chosen in 2.1 which is being intersected by L? Perhaps choosing v4 would have been less confusing in 2.2.
October 25th, 2008 at 12:44 am
Hmm. that is true. good point.
October 26th, 2008 at 12:50 pm
On problem 2, what exactly are we calculating? It says the desired output is the set of all points from P that lie to one side of l. Which side of l? Do we pick? In the example it’s the left side, but I assume this isn’t always the case.
Then in the directions, 2.2, it says add the count of points represented by the contained node to the overall count. This seems to be weird. If the side eliminated is on the right side, and you are wanting the points on the left side, why are you adding these to the “total count”?
Care to shed any light on this?
October 26th, 2008 at 12:55 pm
As the question states, the “side” is defined as the left side of the query line, when moving from left to right.
For the second part, my clarification above is relevant. First of all, we are given that a line intersects at most three of the four regions at each level. The fourth region is therefore completely on the “to-be-included” side of the line, in which case we merely add its points in, or is completely on the “not to be included” side of the line, in which case we ignore it.