1

Given 3 points $((x_1, y_1), (x_2, y_2), (x_3, y_3))$, how can I find if the point $(a, b)$ is between all of these points? In addition, how might one go about writing an equation to graph the area between these three points as a triangle?

Kenta S
  • 16,151
  • 15
  • 26
  • 53
  • 3
    this might help – lulu Feb 12 '18 at 18:48
  • Welcome to stackexchange. Hint: the equation for a line tells you when a point is on a line. It can also tell you which side of the line it's on if it's not on the line. I don't think you can find an "equation" that graphs that triangle. – Ethan Bolker Feb 12 '18 at 18:50

2 Answers2

1

Let $\,z = a + ib\,$, and let $\,z_1,z_2,z_3\,$ be the vertices of the triangle in the complex plane.

For the first question, $\,z\,$ is inside the triangle iff the triplets $\,z,z_1,z_2\,$, $\,z,z_2,z_3\,$, $\,z,z_3,z_1\,$ have the same orientation. That can be checked by comparing the signs of the oriented area of each triangle.

For the second question, $\big\{\, \lambda_1 z_1 + \lambda_2z_2+\lambda_3z_3 \;\big|\; \lambda_{1,2,3} \in (0,1), \;\lambda_1+\lambda_2+\lambda_3=1\,\big\}\,$ is the parametric representation of the interior of the triangle $\,z_1z_2z_3\,$, as a particular case of the general convex combinations for $\,n=3\,$.

dxiv
  • 76,497
0

For the first question:

Find the vectors connecting the point to each of the triangle's three vertices and sum the angles between those vectors. If the sum of the angles is $2*\pi$ then the point is inside the triangle.

For the second question:

Not sure what you want. See the following link:

Finding out the area of a triangle if the coordinates of the three vertices are given