Trigonometric function
Vector
The amount of magnitude and direction in a linear space.
Coordinate representation: $P (X_1,y_1), Q (x_2,y_2) $.
$\overrightarrow{pq}= (x_2-x_1,y_2-y_1) $.
$| pq|=\sqrt{(x_2-x_1) ^2+ (y_2-y_1) ^2}$.
Vector operations
$a = (x_1,y_1), b= (x_2,y_2) $.
$a +b= (x_1+x_2,y_1+y_2) $.
$a-b= (x_1-x_2,y_1-y_2) $.
$a \;\cdot\;b=x_1x_2+y_1y_2$.
$a \;\cdot\;b=|a| | b|cos<a,b>$
Application: To find the angle between two vectors to determine whether vertical ($cos 90$°$=0$).
$a \;\times\;b=x_1y_2-x_2y_1$.
$|a\;\times\;b|=|a| | b|sin<a,b>$.
$a \;\times\;b=0$, common line.
Judging line segment Intersection
$ (ac\;\times\; AD) (bc\;\times\; BD) \;\leq\;0$ and $ (ca\;\times\; CB) (da\;\times\;D b) \;\leq\;0$.
Vector rotation
The $ A (x_1,y_1) $ counter-clockwise rotation $\theta$ (radians) gets $b (X_1cos\theta-y_1sin\theta,x_1sin\theta+y_1cos\theta) $.
$P. s.$ only change direction (length unchanged). Memory method: Rotate $\pi/2$ to get the result $ (-y_1,x_1) $.
Three-point co-line
The angle is $0$ and $a\;\times\;b=0$.
Whether the point is on the ray
The angle is $0$ and the point multiplication $\geq\;0$.
$<0$, Reverse!
Polygon Area
Set the polygon vertices to $p_1,p_2,..., p_n$ in turn.
$\large{s=|\frac{\sum_{i=1}^{n-1}\overrightarrow{op_i}\times\overrightarrow{op_{i+1}}+\overrightarrow{op_n}\ times\overrightarrow{op_{1}}}{2}}|$.
Point to line perpendicular
Point to line perpendicular $d,ed\;\perp\; ab$.
Rotate the $\overrightarrow{ab}\pi/2$.
Straight line intersection.
The position relationship of the circle
$d $ is the center distance of two circles, $R, the R $ is two circle radius respectively.
$d >r+r$ away from the outside;
$d =r+r$ and circumscribed;
$| r–r|<d<r+r$ intersect;
$d =| r–r|$ inner cut;
$d <| r–r|$ included.
Whether the point is within a convex polygon
Random Ray
Recommended
http://dev.gameres.com/Program/Abstract/Geometry.htm# to determine whether a point is in a polygon
[Learning Notes] Computational geometry basics