Update
This commit is contained in:
parent
e074c9eb6e
commit
8c38cbc178
7 changed files with 34 additions and 12 deletions
|
@ -6,6 +6,8 @@ Analytic geometry is part of [mathematics](math.md) that solves [geometric](geom
|
|||
|
||||
Anyway, **how does it work?** Typically we work in a 2D or 3D [Euclidean space](euclidean_space.md) with [Cartesian coordinates](cartesian_coords.md) (but of course we can generalize to more dimensions etc.). Here, geometric shapes can be described with [equations](equation.md) (or [inequalities](inequality.md)); for example a zero-centered circle in 2D with radius *r* has the equation *x^2 + y^2 = r^2* ([Pythagorean theorem](pythagorean_theorem.md)). This means that the circle is a set of all points *[x,y]* such that when substituted to the equation, the equation holds. Other shapes such as [lines](line.md), [planes](plane.md), [ellipses](ellipse.md), [parabolas](parabola.md) have similar equations. Now if we want to find intersections/unions/etc., we just solve systems of multiple equations/inequalities and find solutions (coordinates) that satisfy all equations/inequalities at once. This allows us to do basically anything we could do with pen and paper such as defining helper shapes and so on. Using these tools we can compute things such as angles, distances, areas, collision points and much more.
|
||||
|
||||
Analytic geometry is closely related to [linear algebra](linear_algebra.md).
|
||||
|
||||
## Example
|
||||
|
||||
Let's say we want to find, in 2D, where a line *L* intersects a circle *C*. *L* goes through points *A = [-3,0.5]* and *B = [3,2]*. *C* has center at *[0,0]* and radius *r = 2*.
|
||||
|
@ -40,4 +42,8 @@ Note that this makes perfect sense: a quadratic equation can have either one, tw
|
|||
Solving quadratic equation is simple so we skip the details. Here we get two solutions: *x1 = 1.24881* and *x2 = -1.83704*. These are the x position of our intersections. We can further find also the y coordinates by simply substituting these into the line equation, i.e. we get the final result:
|
||||
|
||||
- intersection 1: *[1.24881, 1.5622025]*
|
||||
- intersection 2: *[-1.83704, 0.79074]*
|
||||
- intersection 2: *[-1.83704, 0.79074]*
|
||||
|
||||
## See Also
|
||||
|
||||
- [linear algebra](linear_algebra.md)
|
Loading…
Add table
Add a link
Reference in a new issue