TRIANGLE SOLVER - Printable Version +- HP Forums ( https://www.hpmuseum.org/forum)+-- Forum: HP Software Libraries ( /forum-10.html)+--- Forum: HP Prime Software Library ( /forum-15.html)+--- Thread: TRIANGLE SOLVER ( /thread-17942.html) |

TRIANGLE SOLVER - BERNARD MICHAUD - 01-17-2022 08:15 PM
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 RE: TRIANGLE SOLVER - Tim Roche - 03-02-2022 07:59 PM
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 RE: TRIANGLE SOLVER - BERNARD MICHAUD - 03-08-2022 01:36 AM
(03-02-2022 07:59 PM)Tim Roche Wrote: Bernard 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. RE: TRIANGLE SOLVER - Tim Roche - 03-09-2022 02:24 AM
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. RE: TRIANGLE SOLVER - BERNARD MICHAUD - 03-09-2022 02:52 AM
(03-09-2022 02:24 AM)Tim Roche Wrote: Bernard, Hi Tim I resent the program as a (.hpprgm) format rather than a .zip format. Let me know if that works. Bernard RE: TRIANGLE SOLVER - Dougggg - 03-09-2022 04:45 AM
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) RE: TRIANGLE SOLVER - Tim Roche - 03-09-2022 06:47 AM
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. RE: TRIANGLE SOLVER - BERNARD MICHAUD - 03-09-2022 01:40 PM
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 |