Post Reply 
newRPL - build 1255 released! [updated to 1299]
04-28-2019, 07:03 PM (This post was last modified: 04-28-2019 07:08 PM by 3298.)
Post: #416
RE: newRPL - build 1089 released! [update:build 1158]
Going on a tangent again...
(04-28-2019 08:30 AM)Gilles Wrote:  If I'm not mistaken, RPL has no specific object for 'angle'.
It has. The stock firmware uses the regular units system for them, which also gives you angle conversion for free. (100_grad 1_arcmin CONVERT -> 5400_arcmin) Even plain numbers are accepted for conversions, CONVERT treats them as having the unit of the current angle mode just like the trig commands do!
The only thing missing is a way to output in DMS. Input is possible by adding numbers with \^o, arcmin, arcs units together; slightly unwieldy, but it works.
Fortunately, DMS output could be retrofitted like this:
Code:
\<<
  DUP 1._\^o CONVERT IP
  OVER 1._arcmin CONVERT IP OVER 1._arcmin CONVERT -
  ROT 1._arcs CONVERT PICK3 PICK3 + 1._arcs CONVERT -
\>>
... That little program splits any angle into the three DMS components. (Lots of CONVERT here, but a simple variant down-converting through \^o, arcmin, arcs and splitting via DUP IP SWAP FP tends to introduce rounding errors when it receives a value that is in arcmin or arcs already.) Maybe this is not settable as a mode, but you can stick the program into a custom menu or a key definition so it's available on demand...
Even better, with library 256 you can have it construct a symbolic object containing the unevaluated sum, which would only occupy a single stack level instead of three. (Inspired by what complex numbers look like when flag -27 is set.)
Code:
\<<
  DUP 1._\^o CONVERT IP
  OVER 1._arcmin CONVERT IP OVER 1._arcmin CONVERT -
  ROT 1._arcs CONVERT PICK3 PICK3 + 1._arcs CONVERT -
  { + } OBJ\-> DROP DUP UNROT 5. \->ALG
\>>
Unlike complex numbers this needs an EVAL to be accepted for conversion. Other calculations get appended without being carried out; all of this happens because it's no longer a unit object but an algebraic instead.

Claudio, what will happen to existing programs using unit objects for angles - will they work in newRPL at some point?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: newRPL - build 1001 released! - pier4r - 12-16-2017, 08:03 AM
newRPL - on Hp 39gs - Martin Hepperle - 06-05-2019, 06:51 AM
RE: newRPL - build 1001 released! - pier4r - 12-23-2017, 10:16 AM
RE: newRPL - build 1001 released! - pier4r - 01-01-2018, 09:42 AM
t - Claudio L. - 01-01-2018, 03:06 PM
RE: newRPL - build 1001 released! - pier4r - 01-01-2018, 03:41 PM
RE: newRPL - build 1001 released! - pier4r - 01-02-2018, 04:54 PM
RE: newRPL - build 1001 released! - pier4r - 01-02-2018, 06:58 PM
newRPL - brickviking - 10-05-2018, 06:01 AM
RE: newRPL - build 1089 released! [update:build 1158] - 3298 - 04-28-2019 07:03 PM
How to participate? - erazor - 12-13-2019, 07:12 AM



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