(42S) Determine Circle From Three Given Points
|
07-15-2018, 04:38 PM
(This post was last modified: 07-15-2018 04:45 PM by Dieter.)
Post: #2
|
|||
|
|||
RE: (42S) Determine Circle From Three Given Points
(07-15-2018 08:43 AM)gerry_in_polo Wrote: Calculates the center and radius of the circle passing through three given points. Example, enter X1=1, Y1=4, X2=-1, Y2=2, X3=4, Y3=-3. Result, center (Xc,Yc)=(2.5,0.5) and radius R=3.8079. Thank you very much for your program. This problem, solving a circle through three given points, reminds me of the early days with my first programmable calculator, a 34C. I had a HP67/97 book which included auch a program, and I tried to adapt it for the 34C. Essentially the problem boils down to solving a linear equation system with three unknowns. In matrix notation it can be written this way: Code: (x1 y1 -1) (2*xc ) (x1² + y1²) Since the 42s features matrix support, this approach can be implemented in a quite compact program. So here is my alternative solution: Code: 00 { 184-Byte Prgm } Note: "|-" means "append", "^" is "↑" and "\LF" is a line feed. Your example: Code: XEQ "CIRCLE" Since I am not very familiar with 42s matrix programming the program can probably be improved with more efficient code. So if someone can provide a better version: go ahead. Dieter |
|||
« 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: 2 Guest(s)