Line drawing support

Contributions to this software library are always welcome. Please ensure that you post program listings rather than .raw files. They give a reasonable idea of what your program does without having to load them into a DM42 and you can also include comments in your code. Check out the following link for a decoder/encoder: http://www.swissmicros.com/dm42/decoder/

You can then copy/paste the listing and post it in "code" tags.
grsbanks
Posts: 712
Joined: Tue Apr 25, 2017 9:23 am
Location: Preston, Lancs, UK

Re: Line drawing support

Post by grsbanks » Tue Feb 13, 2018 1:17 pm

keithdalby wrote:
Tue Feb 13, 2018 8:27 am
I read somewhere that Sanskrit would be a better technical language because of how it was invented to convey technical religious ideas, but I've no time to learn Sanskrit now. Or English, for that matter.
Ironically enough, English evolved from Sanskrit. All the so-called Indo-European languages did. Some English words clearly have the same origins as their Hindi counterparts. For example:

Ma (mother) = maan (मां)
Father = pita (पिता -- 'p' and 'f' sounds are often interchangeable in languages)

This book makes a very interesting read: https://www.amazon.co.uk/Empires-Word-L ... 007118716/
Not SwissMicros staff, just an enthusiast.

User avatar
Walter
Posts: 810
Joined: Tue May 02, 2017 9:13 am
Location: Close to FRA, Germany

Re: Line drawing support

Post by Walter » Tue Feb 13, 2018 1:36 pm

grsbanks wrote:
Tue Feb 13, 2018 1:17 pm
keithdalby wrote:
Tue Feb 13, 2018 8:27 am
I read somewhere that Sanskrit would be a better technical language because of how it was invented to convey technical religious ideas, but I've no time to learn Sanskrit now. Or English, for that matter.
Ironically enough, English evolved from Sanskrit. All the so-called Indo-European languages did. Some English words clearly have the same origins as their Hindi counterparts. For example:

Ma (mother) = maan (मां)
Father = pita (पिता -- 'p' and 'f' sounds are often interchangeable in languages)
Don't reason based on these two words! Else you'd claim that these English words have the same origins as their Mandarin (Chinese) counterparts:

Ma (mother) = mā (妈)
Father = bà (爸 -- 'b' and 'f' sounds are often interchangeable in languages)
DM42 SN: 00041 --- Follower of Platon.

HP-35, HP-45, ..., HP-50, WP 34S, WP 31S, DM16L

grsbanks
Posts: 712
Joined: Tue Apr 25, 2017 9:23 am
Location: Preston, Lancs, UK

Re: Line drawing support

Post by grsbanks » Tue Feb 13, 2018 1:41 pm

Walter wrote:
Tue Feb 13, 2018 1:36 pm
Don't reason based on these two words! Else you'd claim that these English words have the same origins as their Mandarin (Chinese) counterparts:
Fair point. I'm only going on what I have read in various books (including the one I linked to) and those two words were just two that came off the top of my head. There are plenty more but I can't remember them off-hand.
Not SwissMicros staff, just an enthusiast.

User avatar
Walter
Posts: 810
Joined: Tue May 02, 2017 9:13 am
Location: Close to FRA, Germany

Re: Line drawing support

Post by Walter » Tue Feb 13, 2018 1:48 pm

There are more funny things:

Italian 'cantina' = cān tīng (餐厅), so one could speculate about Marco Polo's role in spreading words. ;)
DM42 SN: 00041 --- Follower of Platon.

HP-35, HP-45, ..., HP-50, WP 34S, WP 31S, DM16L

Thomas Okken
Posts: 492
Joined: Tue May 02, 2017 3:48 pm
Location: New Jersey, USA
Contact:

Re: Line drawing support

Post by Thomas Okken » Tue Feb 13, 2018 1:51 pm

I thought English and Sanskrit were both descendants of Proto-Indo-European, just like all the other Indo-European languages. None of the living Indo-European languages are descendants of each other (well, except for Afrikaans, which really is a descendant of Dutch, just different enough that it's not considered a dialect any more).

Anyway, as Walter suggested, beware anecdotal evidence. If the family relationship made Indo-European languages similar, I'd expect to be able to make at least a little bit of sense out of, say, Hindi, Persian, Russian, or Irish, but in reality, I can't, and I'm stumped even by Swedish, Danish, and Norwegian, which are much more closely related to the languages I grew up with than any of those others.

keithdalby
Posts: 498
Joined: Mon Apr 24, 2017 6:38 pm

Re: Line drawing support

Post by keithdalby » Tue Feb 13, 2018 2:34 pm

Common origin, as opposed to 'descended from'.

Stéphane Th
Posts: 17
Joined: Mon Sep 24, 2018 6:23 pm

Re: Line drawing support

Post by Stéphane Th » Tue Oct 09, 2018 12:22 am

and back to the original topic, this program is awesome !
I have added a sort of benchmark, so will publish modified prog + extra one to benchmark.
Awesome !
hp 35/01/67/34c/41cv/41cx/15c/48g/42s/dm42 and also TI SR56/57

whuyse
Posts: 30
Joined: Thu Dec 21, 2017 12:23 pm

Re: Line drawing support

Post by whuyse » Mon Oct 15, 2018 12:45 pm

Hi, this is my version of LINE.

differences with yours:
  • it doesn't round the inputs. PIXEL rounds the inputs anyway.
  • speed-optimized inner loop, using "x" AGRAPH instead of PIXEL, so no need to test negative input.
  • It is independent of the CRES/RRES setting (yours isn't, you perform a SQRT on a negative number to obtain a complex one)
  • it returns the 'destination' coordinates x1 and y1 - either as a complex number or two reals, depending on how they were input - making it easy to 'chain' lines.

Code: Select all

00 { 108-Byte Prgm }
01▸LBL "LINE"
02 X<>Y
03 FS? 73
04 GTO 00
05 COMPLEX
06 1
07 GTO 01
08▸LBL 00
09 RECT
10 COMPLEX
11 3
12▸LBL 01
13 R↓
14 REAL?
15 ISG ST T
16 X<> ST Z
17 COMPLEX
18 STO- ST Y
19 R↑
20 1ᴇ6
21 ÷
22 ENTER
23 COMPLEX
24 STO+ ST Y
25 X<> ST L
26 1ᴇ6
27 ×
28 R↑
29 COMPLEX
30 X<0?
31 +/-
32 X<>Y
33 X<0?
34 +/-
35 X>Y?
36 X<>Y
37 R↓
38 X>0?
39 STO÷ ST L
40 +/-
41 X<> ST Z
42 LASTX
43 R↓
44 "×"
45▸LBL 05
46 AGRAPH
47 RCL+ ST T
48 ISG ST Z
49 GTO 05
50 LASTX
51 COMPLEX
52 IP
53 X<>Y
54 IP
55 GTO IND ST T
56▸LBL 02
57 X<>Y
58 COMPLEX
59▸LBL 01
60 RTN
61▸LBL 04
62 X<>Y
63 COMPLEX
64▸LBL 03
65 POLAR
66 END
Cheers, Werner
42S #3249S01123
DM42 #00345

Stéphane Th
Posts: 17
Joined: Mon Sep 24, 2018 6:23 pm

Re: Line drawing support

Post by Stéphane Th » Tue Oct 30, 2018 1:01 pm

Modified original prog + added link with my bench program (like mandelbrot program)
Image
Image
Image
Image
hp 35/01/67/34c/41cv/41cx/15c/48g/42s/dm42 and also TI SR56/57

Stéphane Th
Posts: 17
Joined: Mon Sep 24, 2018 6:23 pm

Re: Line drawing support

Post by Stéphane Th » Thu Nov 01, 2018 7:04 pm

humm, I check how to post programs
hp 35/01/67/34c/41cv/41cx/15c/48g/42s/dm42 and also TI SR56/57

Post Reply