(42S) Determine Circle From Three Given Points
|
07-16-2018, 07:19 AM
(This post was last modified: 07-16-2018 11:55 AM by Dieter.)
Post: #5
|
|||
|
|||
RE: (42S) Determine Circle From Three Given Points
(07-16-2018 01:19 AM)gerry_in_polo Wrote: Another observation: your program is 79 lines long, mine is 87, not really a significant difference ... Your program can even be shorter by using RCL-arithmetic. On the other hand my version has a quite elaborate output routine. Line 65 ff. can be replaced with a simple Code: 65 VIEW "XC" Then take a look at the byte count. With the above simplification it's down to 149 Bytes. (07-16-2018 01:19 AM)gerry_in_polo Wrote: ...although a different approach is always worth knowing. Yes, that's exactly why I posted it. This is just another way of solving the same problem. Isn't this what forums are all about? But let me explain why I chose this method: The approach here is the general circle equation: (X–Xc)² + (Y–Yc)² = R². The program solves the resulting equation system for the three given points. There is one significant advantage of this method: it doesn't matter if two Y-values are the same. Try (0|2), (4|2) and (2|0) and the program correctly returns the center at (2|2) and a radius of 2. This will not work with the other approach where a division by (Y2–Y1) and (Y3–Y2) takes place. 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: 1 Guest(s)