Post Reply 
NewRPL: Draw commands
06-06-2019, 01:38 PM (This post was last modified: 06-06-2019 01:52 PM by compsystems.)
Post: #1
NewRPL: Draw commands
Hello, it would be very interesting to incorporate drawing commands to motivate more users to use NewRPL.

For example

TI-Nspire: DrawArc 20, 20, 100, 100, 0, 90
NewRPL: 20 20 100 100 0 90 DrawArc


TI-Nspire:
xlist := {0, 200, 150, 0}
ylist := {10, 20,150, 10}
DrawPoly xlist, ylist

NewRPL:
{0, 200, 150, 0} 'xlist' STO
{10, 20, 150, 10} 'ylist' STO
xlist ylist DrawPoly


Source

https://education.ti.com/html/webhelp/EG...ommand.htm

Another option is to adapt Python graphics syntax to RPL

[Image: 1558613789XsIikoU_1_.png]

PHP Code:
def modf(a,b):
  return 
a-b*int(a/b)

def rosace(n=12,r=31,v=True):
  
o=0.
  ne
=n+(n%2)
  
a=360/n
  l
=r*sin(a*pi/360)
  for 
d in range(n):
    if 
v:
      
avance  r
      avance  
-r
      tourne_gauche  a
/2
      avance  r
      avance  
-r
      tourne_gauche  
-a/2
    
for k in range(ne):
      
avance  l
      tourne_gauche a
/(1+((n!=ne) and ((k==ne/2-1) or (k==ne-1))))
    
tourne_gauche a

def demo
(n):
  
efface 
  leve_crayon  
  avance  0
  pas_de_cote  
-3
  baisse_crayon  
  rosace
(n,32

symboLibre https://symbolibre.org A graphing calculator + CAS + Python entirely built around the free software philosophy
Find all posts by this user
Quote this message in a reply
06-06-2019, 02:25 PM (This post was last modified: 06-06-2019 02:26 PM by JoJo1973.)
Post: #2
RE: NewRPL: Draw commands
If you look the sources on Sourceforge you'll see that a sophisticated graphical library is in the making.

So, keep the faith! Wink
Find all posts by this user
Quote this message in a reply
06-06-2019, 02:54 PM (This post was last modified: 06-06-2019 02:54 PM by compsystems.)
Post: #3
RE: NewRPL: Draw commands
(06-06-2019 02:25 PM)JoJo1973 Wrote:  If you look the sources on Sourceforge you'll see that a sophisticated graphical library is in the making.
...
ok

What would be the port to newRPL language of the previous code?

symboLibre https://symbolibre.org A graphing calculator + CAS + Python entirely built around the free software philosophy
Find all posts by this user
Quote this message in a reply
Post Reply 




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