Parameters: float x, float y
Returns: float
Parameters: float ax, float ay, float bx, float by
Given two vectors ax/ay and bx/by, returns the dot product.
If the result is 0, the two vectors are orthogonal. If the result is > 0, they point into the same general direction. If the result is < 0, they point into opposite directions. This can be geometrically interpreted as "how far one vector goes along the direction of the other vector". For example, if we have two vectors a = (4, -3) and b = (4, 0). Then: |a| = 5 |b| = 4 a.b = 16 cos = a.b / |a| / |b| = 0.8 (36.87°) length of a projected onto b: a.b / |b| = 4 length of b projected onto a: a.b / |a| = 3.2
Given two vectors ax/ay and bx/by, returns the cross product.
If the result is 0, the two vectors are parallel. If the result is > 0, b points more to the left than a (if y goes up). If the result is < 0, b points more to the right than a (if y goes up). Geometrically, this is "how far away does one vector go from the other". For example, if we have two vectors a = (4, -3) and b = (4, 0). Then: |a| = 5 |b| = 4 axb = 4 * 0 - -3 * 4 = 12 sin = axb / |a| / |b| = 0.6 (36.87°) distance of a from b: axb / |b| = 3 distance of b from a: axb / |a| = 2.4
Parameters: float ax, float ay, float * bx, float * by
Returns a vector orthogonal to ax/ay. More specifically, returns a vector rotated 90 degree to the right (with y axis going down).
Parameters: LandFloat * x, LandFloat * y, LandFloat angle
Rotate x/y around 0/0 by angle in counter clockwise direction. cos(0) = 1, cos(45°) = 0.7, cos(90°) = 0 sin(0) = 0, sin(45°) = 0.7, sin(90°) = 1 0/1 -0.7/0.7 0.7/0.7 . . . . 0——1/0
Parameters: LandFloat l1x1, LandFloat l1y1, LandFloat l1x2, LandFloat l1y2, LandFloat l2x1, LandFloat l2y1, LandFloat l2x2, LandFloat l2y2
Returns: bool
Checks if two line segments collide.
Parameters: LandFloat c1x1, LandFloat c1y1, LandFloat c1r, LandFloat c2x1, LandFloat c2y1, LandFloat c2r
Parameters: LandFloat lx1, LandFloat ly1, LandFloat lx2, LandFloat ly2, LandFloat cx1, LandFloat cy1, LandFloat cr