(42S) Determine Circle From Three Given Points
|
07-17-2018, 01:21 PM
Post: #6
|
|||
|
|||
RE: (42S) Determine Circle From Three Given Points
The HP-42S allows to use complex numbers to solve the problem.
Formula The three complex number \(a\), \(b\) and \(c\) represent the vertices of the triangle. Define the following: \[ \begin{eqnarray} p=c+a \\ P=c-a \\ \\ q=a+b \\ Q=a-b \end{eqnarray} \] Then for the center \(z\) of the circle the following holds true: (The \(\cdot\) is for the dot-product.) \[ \begin{eqnarray} P\cdot(z-\frac{p}{2})=0 \\ Q\cdot(z-\frac{q}{2})=0 \end{eqnarray} \] This means that the vector from the center to the midpoint is perpendicular to the sides of the triangle. Given: \[ \begin{eqnarray} u=P\cdot p \\ v=Q\cdot q \end{eqnarray} \] We can rewrite these equations: \[ \begin{eqnarray} P\cdot z=P\cdot\frac{p}{2}=\frac{u}{2} \\ Q\cdot z=Q\cdot\frac{p}{2}=\frac{v}{2} \end{eqnarray} \] Or then: \[ \begin{eqnarray} P\cdot 2z=u \\ Q\cdot 2z=v \end{eqnarray} \] Using: \[ \begin{eqnarray} P=P_x+iP_y \\ Q=Q_x+iP_y \\ \\ z=x+iy \\ w=v+iu \end{eqnarray} \] This equation can be written using matrix notation: \[ \begin{bmatrix} P_x & P_y \\ Q_x & Q_y \end{bmatrix} \begin{bmatrix} 2x \\ 2y \end{bmatrix} = \begin{bmatrix} u \\ v \end{bmatrix} \] If we transpose this matrix we can rewrite the equation as: \[ \begin{eqnarray} g=Q_x+iP_x \\ h=Q_y+iP_y \\ \\ 2x\cdot g+2y\cdot h=w \end{eqnarray} \] This equation can be cross multiplied both by \(h\) and \(g\): (Reminder: \(h\times h=g\times g=0\).) \[ \begin{eqnarray} 2x\cdot h\times g=h\times w \\ 2y\cdot h\times g=w\times g=-g\times w \end{eqnarray} \] The determinant is: \[ D=h\times g \] We end up with: \[ \begin{eqnarray} x=\frac{h\times w}{2D} \\ y=-\frac{g\times w}{2D} \end{eqnarray} \] Program Code: 00 { 69-Byte Prgm } ; X Y Z T The radius of the circle isn't calculated. But that should be easy now that we know the center. Example: A = (1, 4) B = (-1, 2) C = (4, -3) 1 ENTER 4 COMPLEX -1 ENTER 2 COMPLEX 4 ENTER -3 COMPLEX XEQ "CENTER" 2.5 i0.5 Kind regards Thomas |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(42S) Determine Circle From Three Given Points - gerry_in_polo - 07-15-2018, 08:43 AM
RE: (42S) Determine Circle From Three Given Points - Dieter - 07-15-2018, 04:38 PM
RE: (42S) Determine Circle From Three Given Points - gerry_in_polo - 07-16-2018, 12:49 AM
RE: (42S) Determine Circle From Three Given Points - gerry_in_polo - 07-16-2018, 01:19 AM
RE: (42S) Determine Circle From Three Given Points - Dieter - 07-16-2018, 07:19 AM
RE: (42S) Determine Circle From Three Given Points - Thomas Klemm - 07-17-2018 01:21 PM
RE: (42S) Determine Circle From Three Given Points - Dieter - 07-17-2018, 07:17 PM
|
User(s) browsing this thread: 3 Guest(s)