Post Reply 
TRIANGLE SOLVER
01-17-2022, 08:15 PM (This post was last modified: 03-09-2022 08:34 PM by BERNARD MICHAUD.)
Post: #1
TRIANGLE SOLVER
TRIANGLE SOLVER: Updated Jan. 28,2022

----Final correction to the program.----



Not sure if this occurs in Window but does occur on the Mac.

If you download the program and you get an error
do the following. With the program name Highlighted
press [Edit] goto the last line of the program, by
pressing [Shift] and down on the Navigation circle
which will take you directly to line 330 End; and delete
any characters following the ; example:330 End; [] [] a


Attached File(s)
.pdf  Right Triangle.pdf (Size: 573.92 KB / Downloads: 82)
.pdf  Triangle Solver.pdf (Size: 733.91 KB / Downloads: 102)
.hpprgm  TRIANGLE SOLVER.hpprgm (Size: 29.11 KB / Downloads: 43)
Find all posts by this user
Quote this message in a reply
03-02-2022, 07:59 PM (This post was last modified: 03-03-2022 09:40 PM by Tim Roche.)
Post: #2
RE: TRIANGLE SOLVER
Bernard

Tried your triangle solver program on my win10 virtual calculator (2021 10 01) and my old (G1) prime (2021 12 02). In both instances the loaded program gives a syntax error on line 288. (I noticed your warning about extra characters at the tail of the program listing and checked.) There does not seem to be any error on line 288 that I discern.

Could you suggest what I might do to remedy this problem?

Tim

ter
Find all posts by this user
Quote this message in a reply
03-08-2022, 01:36 AM (This post was last modified: 03-08-2022 03:02 PM by BERNARD MICHAUD.)
Post: #3
RE: TRIANGLE SOLVER
(03-02-2022 07:59 PM)Tim Roche Wrote:  Bernard

Tried your triangle solver program on my win10 virtual calculator (2021 10 01) and my old (G1) prime (2021 12 02). In both instances the loaded program gives a syntax error on line 288. (I noticed your warning about extra characters at the tail of the program listing and checked.) There does not seem to be any error on line 288 that I discern.

Could you suggest what I might do to remedy this problem?

Tim


Line 288 should read:
Also Check variable Z1 to see if it is active.

286 IF mnu THEN MENU(); END;
287 //---------------------------------------------------
288 D:=√((X1-x2)^2+(Y1-y2)^2);Z1:=((X1+x2)/2,(Y1+Y2)/2);
289 Slp:=(Y2-Y1)/(X2-X1);θ:=ATAN(Slp);Int:=Y1-X1*Slp;
290 //---------------------------------------------------


328 EXPORT TRIANGLES()
329 BEGIN
330 2▶AFormat;
331 3▶ADigits;
332 MENU();
333 END; Odd characters will appear here This may not appear on Window version but it does on a Mac.
Find all posts by this user
Quote this message in a reply
03-09-2022, 02:24 AM
Post: #4
RE: TRIANGLE SOLVER
Bernard,

Thank you for replying to my query.

I have looked at line 288 in your Triangle Solver code and can find no discrepancies with the listing in your reply; this is not a surprise, as the code is that which you uploaded in the original post. Yet on my Win10 laptop the virtual prime (2021 10 1) stops the compilation at line 288.

Concerning line 333 at the end of the file, I see the following (removing the comment characters has no effect)

327 //--------------------
328 EXPORT TRIANGLES()
329 BEGIN
330 2▶AFormat;
331 3▶ADigits;
332 MENU();
333 END;//

Wondering if I am alone with this difficulty.

ter
Find all posts by this user
Quote this message in a reply
03-09-2022, 02:52 AM
Post: #5
RE: TRIANGLE SOLVER
(03-09-2022 02:24 AM)Tim Roche Wrote:  Bernard,

Thank you for replying to my query.

I have looked at line 288 in your Triangle Solver code and can find no discrepancies with the listing in your reply; this is not a surprise, as the code is that which you uploaded in the original post. Yet on my Win10 laptop the virtual prime (2021 10 1) stops the compilation at line 288.

Concerning line 333 at the end of the file, I see the following (removing the comment characters has no effect)

327 //--------------------
328 EXPORT TRIANGLES()
329 BEGIN
330 2▶AFormat;
331 3▶ADigits;
332 MENU();
333 END;//

Wondering if I am alone with this difficulty.

Hi Tim
I resent the program as a (.hpprgm) format rather than a .zip format.
Let me know if that works.

Bernard
Find all posts by this user
Quote this message in a reply
03-09-2022, 04:45 AM
Post: #6
RE: TRIANGLE SOLVER
I maybe wrong but I did not find lower case x2 or lower case y2 declared any where so I changed them to upper case X2 and Y2 and the program appeared to work

288 D:=√((X1-x2)^2+(Y1-y2)^2);Z1:=((X1+x2)/2,(Y1+Y2)/2)
Find all posts by this user
Quote this message in a reply
03-09-2022, 06:47 AM
Post: #7
RE: TRIANGLE SOLVER
Bernard,

Dougggg is correct. (Nice catch.) The formulas for both distance D and midpoint Z1 should read (all caps):

288 D:=√((X1-X2)^2+(Y1-Y2)^2);Z1:=((X1+X2)/2,(Y1+Y2)/2)

With that edit your program compiles and runs as you indented.

Thanks Douggggg and Bernard.

ter
Find all posts by this user
Quote this message in a reply
03-09-2022, 01:40 PM
Post: #8
RE: TRIANGLE SOLVER
Thanks Tim and Douggg

I updated the program. Obviously an error on my part. x2 and y2 were declared as Global variables on a different program I am working on and the Triangle Solver worked on my G2, so I assumed that every thing was ok.

Thanks again and I hope you find the program useful.

Bernard
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)