ZROI 19.08.02 Computational Geometry

1. Vector Basics

  • \ (of atan2 \) can find polar angle, but is not particularly accurate, close coordinates \ (10 ^ {9} \) will pan, the cross product safety practice.

  • Rotation, reflection and translation and so can be abstracted as a matrix, i.e., they may be a composite. (Compulsory four requires some knowledge)

  • To a sequence, each position represents one rotation, reflection, of pan, seeking \ ((x, y) \ ) through the sequence \ ([l, r] \ ) point.

Segment tree maintenance moments like ride, the matrix need to bring in a constant position.

  • Simpson Points

Points will not, leave.

2. A simple question

  • Points by \ (P \) linear \ (p_1p_2 \) projected on.

Projection is the dot product, the product directly on the line,Compulsory four how to learn.


  • Points by \ (P \) linear \ (p_1p_2 \) reflection point.

Exactly the same with the above.


  • Analyzing two vectors \ (5 \) species positional relationship.

Cross product sentenced to two kinds of non-collinear, and the rest directly compare the abscissa on it.


  • To two straight lines, which are parallel or perpendicular to ask or not.

Parallel to the vector cross product \ (0 \) , perpendicular to the vector dot product \ (0 \) .


  • Sentenced to two line segments intersect (not strictly endpoint pay are also considered).

Straddles the experiment: For one segment to see if another two points in a segment of it on both sides, both sides are then to right.

In the case of a straight line would pan.

You can first determine whether the bounding rectangle intersect. (A necessary condition, is not sufficient)


  • Find the intersection of two segments, guaranteed pay (in fact, it can use the above sentence).

The answer is found \ (A \ cdot k_A \) or \ (B \ cdot k_B \) in the form of two columns on the line equations.

Special sentenced collinear case.


  • Seeking two line segment. ( \ (A, B \) and find a point, so that the minimum distance).

Found must take in a wire segment of the endpoint, for the sake of conversion of the line segment to the point.

Calculation \ (A \) in \ (p_1p_2 \) on a projection representing \ (p_1p_2 \) ratio, \ (\ Leq 0 \) from \ (P_1 \) recently, \ (\ GEQ. 1 \) from \ (P_2 \) recently, otherwise the nearest point from the projector.


  • Counterclockwise to a polygon, find the area.

All the way to the cross product of the past like.


  • Counterclockwise to a polygonal, convex whether the request.

All the way past the cross product, cross product should be between the two sides \ (> 0 \) .


  • Counterclockwise to a polygon, the polygon seeking a point on or outside.

Good judgment on the polygon.

Ray method, cross-odd inside, even several times on the outside, but there will be some problems.

A simple way is to set the slope of the ray irrational numbers.

Otherwise, they will special sentence. Ray is hard spot slope \ (0 \) , and horizontally to the right.

Sequentially considering each edge, parallel can ignore.

The nature of the problem to be solved is through the vertex.

If \ (A \) in (R & lt \) \ on, and \ (AB \) upwards or \ (B \) in \ (R & lt \) on, and \ (AB \) and down to the intersection operator.


  • A set of points, find convex hull.

Bad streetClassic problem.


  • To the convex hull, the diameter requirements.

Rotating stuck. Abscissa starting from the minimum and maximum points, each time a forward edge (similar to the double pointer).


  • And a convex polygon to radiation, the area of ​​a convex polygon on the left seeking rays.

Sweep over a convex polygon, the vertex and the intersection meet the requirements of both seek out area.


- \ (the n-\) points find the nearest point pair.

Divide and conquer, to cross the midpoint of the points, just need to find \ (| x_i-x_j | \ ) does not exceed \ (d \) point to. Press (Y \) \ sort, each point contributing point is a constant.


  • The relationship between the circle: from phase ( \ (2 + 2 \) Article common tangent), exo ( \ (1 + 2 \) ), intersect ( \ (2 0 + \) ), endo- ( \ (0 +1 \) ), comprising ( \ (0 + 0 \) ).

  • Find the intersections of circles and straight lines.

String obtained from the heart, you can solve triangle, with the angle can be calculated.


  • Find the intersection of two circles.

And form a trilateral length \ (r_1, r_2, dis ( o_1, o_2) \) of the triangle, the law of cosines to the angle between the solution.


  • Point to the circle tangent point.

Solution triangle required 夹角.


  • Seeking two common tangent circle ( \ (0-4 \) bar).

Sentence about \ (0 \) strip common tangent of the situation. Otherwise, there must be two common tangent.

Since two common tangent perpendicular to the radius, what can be translated, a construct \ (r_1-r_2, d, len \) of the right triangle, the triangle can solutions.

A common tangent formed two similar triangles.


  • Of circular and polygonal cross area.

It can be cut into a plurality of polygons to have a triangular, circular and triangular cross-transformed into the area.

Triangulation may wish to set the center of origin.

If the entire circle within the triangle are returned triangle area.

If the entire \ (AB \) in an outer circle (perpendiculars \ (\ R & lt GEQ \) ), return to the sector area.

Otherwise, according to \ (AB \) and the intersection of the circle cut, recursive processing. Recursive found most often several times.


  • The smallest circle coverage.

Classic question, random incremental method.

3. relatively problem

  • \ (n-\) discs heaven, we will cover the front of the latter, averages the last visible contour line length. \ (the n-\ Leq 1000 \) .

Determined for each disk cover behind its disk angular interval (the sum of two intersection points), and to determine what is visible arc length.


  • A rooted tree, each point there are \ (a_i, b_i \) , the sub-tree to jump from one point some point, the price for \ (a_i \ cdot b_j \) . Ask each point of view, the cost jumps to a minimum any leaf nodes. \ (n-\ Leq. 5 ^ 10 \) .

The slope optimized classic form. Heuristic merger or DSU on tree can be.


  • To a number of vectors, each vector has a price. May be selected from a number, a non-negative combinations thereof coefficient, requires a combination of an arbitrary vector can ask minimum cost. \ (n-\ Leq 2 \ ^ 10. 5 Times \) .

Each vector is equivalent to a radiation. Equivalent to three vectors looking for, so that the polar angle difference between the $ <\ pi $ between any two.

Each vector is negated after the insert, the answer must be found between the end to end \ (<\ PI \) , and answer form "Anyway n" of three vectors.

Japanese sentence case four mutually perpendicular.


  • \ (n-\) points asked how these triangle vertex disjoint points (overlap area \ (0 \) with no intersections). \ (the n-\ Leq 2000 \) .

Conclusion: equivalent to two disjoint triangles they have two common tangent.

You can enumerate two common tangent of points obtained the number of points on both sides.


  • Round inversion: a circle as the base, set the unit circle. Each vector direction to the center point of constant length becomes reciprocal.

  • \ (n-\) operations, each addition of a circle through the origin, or ask a point \ ((x, y) \ ) whether all the internal circle. \ (n-\ Leq. 5 \ ^ 10. 5 Times \) .

Conclusion: too round inversion origin but becomes a straight line from the origin.

In a particular side of a straight line after inversion point inside the circle equivalent to the inversion.

Dynamic cross half-plane, the partition can maintain a convex hull.


  • A circle and an outer circle given two disjoint point on the plane, find the point and through the outer two circles inscribed circle.

Conclusion: But after a round of origin or inversion, but the origin of the circle, and intersecting / tangent positional relationships are still valid after the inversion (because the same point reflection or the same point).

After inversion seek common tangent to the circle, you need some special sentence.


  • Gives \ (n \) disjoint polygons, each is given a point, in which it asked polygon, or a polygon in the absence of any mandatory online. \ (n-, Q \ ^ Leq 10. 5, \ SUM Points \ Leq. 3 \ ^ 10. 5 Times \) .

Disjoint polygons is very limited.

Hard edge points of the polygon is given counterclockwise.

For each point to go up vertically to find the nearest side, from left to right if it is not in, or in the corresponding internal polygon.

If off-line, according to the scanning line at the abscissa, the vertical positional relationship between the maintenance segment. As the line do not intersect, up and down relationship will only change when inserting deleted. With set maintenance on the line.

By force needs a persistent treap, not write.

A lot of special sentence.


Consider a two-dimensional plane, the horizontal axis time and the ordinate dfs sequence.

After the tree becomes a cross-sectional \ (m \ log n \) line segments, the intersection of the first seek time.

Press \ (X \) scan lines, set maintenance (Y \) \ magnitude relation.

If two segments have to pay, they must be adjacent set in at some point, otherwise it will not change any relationship between the two segments.

Insertion and deletion of time to check what predecessor successor.


  • A convex polygon, \ (Q \) group asked to give \ ((x_i, y_i) \) , seeking through this straight line bisecting the convex polygon area, no solution or polar angle output. \ (n-\ ^ Leq 10. 4, Q \ ^. 5 Leq 10 \) .

Set \ (f (x) \) represents a polar angle \ (X \) ray left - right side area. There \ (F (0) = - F (\ PI) \) , zero point to the two points so must exist.

Consideration of the cross product and the prefix request, the first two separated rays which fall on two sides, and internal changes is linear, it can be directly calculated.

4. Application of calculus in the computational geometry

This is a wild dropped ...... I too dishes.


  • Partial derivatives: polyols wherein the guide function only one dimension.

  • Multiple Integral: each dimension polyvalent function are integrated, such as \ (K \) dimensional space, each point in space have taken a function value, there is a limit when taken fine enough.

  • Curve Points: the parametric curves and points.

  • The closed curve area: dropped, Gugu Gu.

  • Extremes of functions of one variable: great does not mean the most, only a small enough neighborhood, the largest in the neighborhood. Derivative is extreme point \ (0 \) .

  • Stagnation: the derivative is \ (0 \) points. Extreme point must be stagnation, stagnation is not necessarily extreme point. Seeking a maximum function, all stationary points can not be dragged out guiding point check bit.

  • For multivariate functions, the partial derivatives for each dimension may be, each deflector and hard spots are \ (0 \) , solving the equation on the line.

  • The original function can be modified, such that it may be turned in some of the boundaries ( \ (| X | -> X ^ 2 \) ).

  • Lagrange multiplier method: Suppose there are several \ (g_i (x_1, ..., x_n) = 0 \) constraints, under such conditions to maximize \ (f (x_0, ..., x_n) \) values , may be provided \ (F (x_0, ..., x_n, \ lambda_0, ..., \ lambda_m) = f (x_0, ..., x_n) + \ sum_ {j = 0} ^ m \ lambda_i g_i (x_1, ..., x_n) \) , then \ (F. \) solving partial derivatives for each dimension, using the above method.

  • Tangent plane curve method: dropped, Gugu Gu.

  • Surface tangent plane, normal: dropped, Gugu Gu.

Guess you like

Origin www.cnblogs.com/suwakow/p/11375072.html