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: https://technical.swissmicros.com/decoders/dm42/

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

Re: Line drawing support

Post by grsbanks »

keithdalby wrote:
Tue Feb 13, 2018 9: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/
There are only 10 kinds of people in the world: those who understand binary and those who do not.
User avatar
Walter
Posts: 3070
Joined: Tue May 02, 2017 11:13 am
Location: On a mission close to DRS, Germany

Re: Line drawing support

Post by Walter »

grsbanks wrote:
Tue Feb 13, 2018 2:17 pm
keithdalby wrote:
Tue Feb 13, 2018 9: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)
WP43 SN00000, 34S, and 31S for obvious reasons; HP-35, 45, ..., 35S, 15CE, DM16L S/N# 00093, DM42β SN:00041
grsbanks
Posts: 1122
Joined: Tue Apr 25, 2017 11:23 am
Location: Preston, Lancs, UK
Contact:

Re: Line drawing support

Post by grsbanks »

Walter wrote:
Tue Feb 13, 2018 2: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.
There are only 10 kinds of people in the world: those who understand binary and those who do not.
User avatar
Walter
Posts: 3070
Joined: Tue May 02, 2017 11:13 am
Location: On a mission close to DRS, Germany

Re: Line drawing support

Post by Walter »

There are more funny things:

Italian 'cantina' = cān tīng (餐厅), so one could speculate about Marco Polo's role in spreading words. ;)
WP43 SN00000, 34S, and 31S for obvious reasons; HP-35, 45, ..., 35S, 15CE, DM16L S/N# 00093, DM42β SN:00041
Thomas Okken
Posts: 1098
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: Line drawing support

Post by Thomas Okken »

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: 564
Joined: Mon Apr 24, 2017 8:38 pm

Re: Line drawing support

Post by keithdalby »

Common origin, as opposed to 'descended from'.
Stéphane Th
Posts: 17
Joined: Mon Sep 24, 2018 8:23 pm

Re: Line drawing support

Post by Stéphane Th »

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: 197
Joined: Thu Dec 21, 2017 1:23 pm

Re: Line drawing support

Post by whuyse »

Hi, this is my version of LINE. [Corrected 2020-08-20]

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 { 109-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 LASTX
41 R↓
42 IP
43 +/-
44 X<> ST Z
45 "×"
46▸LBL 05
47 AGRAPH
48 RCL+ ST T
49 ISG ST Z
50 GTO 05
51 LASTX
52 COMPLEX
53 IP
54 X<>Y
55 IP
56 GTO IND ST T
57▸LBL 02
58 X<>Y
59 COMPLEX
60▸LBL 01
61 RTN
62▸LBL 04
63 X<>Y
64 COMPLEX
65▸LBL 03
66 POLAR
67 END
Cheers, Werner
Last edited by whuyse on Thu Aug 20, 2020 11:34 am, edited 1 time in total.
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L
Stéphane Th
Posts: 17
Joined: Mon Sep 24, 2018 8:23 pm

Re: Line drawing support

Post by Stéphane Th »

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 8:23 pm

Re: Line drawing support

Post by Stéphane Th »

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