Author Topic: [grammer] Problem with trigonometry  (Read 18692 times)

0 Members and 1 Guest are viewing this topic.

Offline persalteas

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 231
  • Rating: +44/-4
  • z80 poweeer
    • View Profile
    • Tout-82
[grammer] Problem with trigonometry
« on: May 12, 2013, 12:44:49 pm »
In this TI-Planet topic (reading not required), we were making comparisons between Basic and Axe means to make a laser rotation like this:



I wanted to try to do this in Grammer, because it combinates the speed of Axe and the lightness of Basic :P

But, as Grammer has no "Degree" mode, i did not manage to make it.
My code looks like this, now:      (I added a patern to the line for fun)

Code: [Select]
:.0:Return
:0->A
:1->B
:ClrDraw
:Return->Z
:A+1->A
:call Lbl "D
:Text('0,0,A
:DispGraph
:Pause 10
:B=0:->B
:call Lbl "D
:Goto Z
:.D
:Rect('47,31,47+100*sin(A),37+100*cos(A),B+4,,2
:End

And... it works not. Can you explain me why ?
Thanks


Offline mdr1

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 303
  • Rating: +21/-2
    • View Profile
Re: [grammer] Problem with trigonometry
« Reply #1 on: May 12, 2013, 01:59:41 pm »
Could you say what the problem is ?



Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: [grammer] Problem with trigonometry
« Reply #2 on: May 12, 2013, 02:26:11 pm »
sin() and cos() in Grammer are basically the same as in Axe. It returns a value from -127 to 127, so when you multiply by 100, it goes way off screen. Here is my rendition:
Code: [Select]
.0:Return
0→A→E
Repeat getKey(15
ClrDraw
IS>(A       ;just to increment A
Text('ºA and 255
62+sin(A
/ 2→B
94+cos(A
/ 2→C
Line('47,31,C,B
Line('48,31,C+1,B
Line('47,32,C,B+1
DispGraph
End
Stop

Offline persalteas

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 231
  • Rating: +44/-4
  • z80 poweeer
    • View Profile
    • Tout-82
Re: [grammer] Problem with trigonometry
« Reply #3 on: May 12, 2013, 02:52:49 pm »
Thanks !

I don't understand your code, but thanks, that will be very good enough ! :)


Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [grammer] Problem with trigonometry
« Reply #4 on: May 12, 2013, 03:47:45 pm »
I say : mine is still faster, you've lost Persalteas :P and it'll be even faster when I'll insert it in IkarugaX's engine.

Offline mdr1

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 303
  • Rating: +21/-2
    • View Profile
Re: [grammer] Problem with trigonometry
« Reply #5 on: May 13, 2013, 12:54:03 pm »
I remind you that the initial debate was not on the speed but on the size of the program.



Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [grammer] Problem with trigonometry
« Reply #6 on: May 13, 2013, 12:54:47 pm »
You can't compare program size between Grammer and Axe. Axe and ASM okay, but not Grammer and Axe.

Offline mdr1

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 303
  • Rating: +21/-2
    • View Profile
Re: [grammer] Problem with trigonometry
« Reply #7 on: May 13, 2013, 12:55:49 pm »
I destroyed this argument on TI-Planet's subject, Matrefeytontias.



Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [grammer] Problem with trigonometry
« Reply #8 on: May 13, 2013, 12:56:35 pm »
I mean, for one program, this program --' you know what I mean.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: [grammer] Problem with trigonometry
« Reply #9 on: May 13, 2013, 12:59:07 pm »
I destroyed this argument on TI-Planet's subject, Matrefeytontias.
Also, you destroyed nothing, we told you about Fusion.
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline mdr1

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 303
  • Rating: +21/-2
    • View Profile
Re: [grammer] Problem with trigonometry
« Reply #10 on: May 13, 2013, 01:04:45 pm »
Also, you destroyed nothing, we told you about Fusion.
Fusion or not, I replied that the program has a size 2.5 times bigger, not having taken into account the 200o routine. Here : https://tiplanet.org/forum/viewtopic.php?f=9&t=11837&start=20#p140370



Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: [grammer] Problem with trigonometry
« Reply #11 on: May 13, 2013, 01:09:58 pm »
That is because Fusion is not developped at its true potential. Its goal is "even more speed", not "even less space", because using it takes less time to compile. But if Fusion was made very efficiency, it would be another story. But it will never since Fusion is mostly for developers and not very much used.
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline mdr1

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 303
  • Rating: +21/-2
    • View Profile
Re: [grammer] Problem with trigonometry
« Reply #12 on: May 13, 2013, 01:13:00 pm »
That is because Fusion is not developped at its true potential. Its goal is "even more speed", not "even less space", because using it takes less time to compile. But if Fusion was made very efficiency, it would be another story. But it will never since Fusion is mostly for developers and not very much used.
I don't mind the cause of that, the essential is that it is a fact. Grammer's programs have a size much less big that Axe's.



Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: [grammer] Problem with trigonometry
« Reply #13 on: May 13, 2013, 01:15:33 pm »
A strong suggestion: only use Axe fusion for testing your own programs, and not for programs you distribute to others. It's really underbaked and I've just barely been keeping it working in the latest Axe releases. I will likely remove it entirely eventually in favor of replacing it with a better, more robust system.

EDIT: And to clarify, the purpose of Axe Fusion was to result in smaller compiled programs. It was not intended to increase either compiling or execution speed.
« Last Edit: May 13, 2013, 01:16:21 pm by Runer112 »

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [grammer] Problem with trigonometry
« Reply #14 on: May 13, 2013, 01:17:43 pm »
That is because Fusion is not developped at its true potential. Its goal is "even more speed", not "even less space", because using it takes less time to compile. But if Fusion was made very efficiency, it would be another story. But it will never since Fusion is mostly for developers and not very much used.
I don't mind the cause of that, the essential is that it is a fact. Grammer's programs have a size much less big that Axe's.

Of course, since they are plain text that gets interpreted. Just try to compile a Grammer program in the ASM resulting of its interpretation and then we'll can talk.