News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

A window problem

Started by Gunther, December 29, 2022, 02:31:20 PM

Previous topic - Next topic

Gunther

I had the idea for this program just before Christmas 2022. After I went to the Christmas market with some students, we visited a church. When I saw the patterns in the leaded windows, I remembered that I had read about those in old
books years ago. For more details, see the file mw.pdf. You should definitely read that, otherwise it's not clear what it's about.

The software is written with PB 3.5 for DOS. However, the dirty calculation work is done by a subroutine in assembly language. The ZIP archive contains the source code and the executable program. The application should run under quite
a few configurations. As an example here is the output under DOSBox 0.74-3:

With this program you can calculate the values for a tracery on leaded
glass windows. The values of the partial areas depend only on the size
of the square side a. It is therefore irrelevant which system of units
is used. If a is specified  in centimeters or inches, then the results
are either square centimeters  or square inches. The  same is true for
meters and yards.

Please enter the size for sqare side a as valid floating point number,
for example 1.5: 2.5

x = .7989
y = .2712
z = 1.9697

Please, press any key to end the application...


However, the program also runs under plain DOS, as DOS emulation or as a virtual machine. The only restrictions are, as a minimum requirement, the presence of the 80386/87 team. That's checked by the software.

Test results from other members would be very nice. I would also welcome some feedback on the readability of the document mw.pdf. Thank you in advance.
You have to know the facts before you can distort them.

hutch--

Hi Gunther,

Your PDF read just fine. Your English is certainly much better than my DE.

zedd151

With this program you can calculate the values for a tracery on leaded
glass windows. The values of the partial areas depend only on the size
of the square side a. It is therefore irrelevant which system of units
is used. If a is specified  in centimeters or inches, then the results
are either square centimeters  or square inches. The  same is true for
meters and yards.


Please enter the size for sqare side a as valid floating point number,
for example 1.5: 3.0


x = 1.1504
y = .3905
z = 2.8363


Please, press any key to end the application...



Seems to work here, Window 7 32 bit...  :thumbsup:
The PDF is fine.  :thumbsup:

Gunther

Steve,

wow, an immediate feedback. Thank you.  :thumbsup:

Quote from: hutch-- on December 29, 2022, 02:40:22 PM
Your PDF read just fine.

That's good to know. It is always such a thing if you are not a native speaker.

Quote from: hutch-- on December 29, 2022, 02:40:22 PM
Your English is certainly much better than my DE.

I can say little about your German because I don't know it. But if you have time next year, feel free to visit me here. After that, your German will definitely be much better.
After all, we would have some important things to discuss in private. I find Berlin especially beautiful in May and June. The city is full of green trees and you can sit in a
sidewalk cafe on every corner and people watch. Just let me know in time when you will come. You can take lodging in my house.
You have to know the facts before you can distort them.

Gunther

zedd151,

Quote from: zedd151 on December 29, 2022, 02:58:48 PM
Seems to work here, Window 7 32 bit...  :thumbsup:
The PDF is fine.  :thumbsup:

thank you for the feedback. I had forgotten that Win 7 (32 bit) has a DOS emulation.
You have to know the facts before you can distort them.

zedd151

#5
Quote from: Gunther on December 29, 2022, 03:05:23 PM
I had forgotten that Win 7 (32 bit) has a DOS emulation.
And I had forgotten that Windows 7 (64 bit) does not.  :biggrin:  So, I quickly installed 32 bit version for this test, on a spare partition.  :tongue:


As a side note... I had to google 'tracery' as I had not heard that term before, iirc. You just added to my vocabulary.  :biggrin:  And to think I thought it was a typo at first.

Gunther

zedd151,

Quote from: zedd151 on December 29, 2022, 03:08:47 PM
And I had forgotten that Windows 7 (64 bit) does not.  :biggrin:  So, I quickly installed 32 bit version for this test, on a spare partition.  :tongue:

that's a pretty big effort for a short test run. Thank you.  :thumbsup: You could, of course, use other options. For small tests or old DOS games DOSBox is a good alternative.
It's a 32 bit Windows application. The DOS program plays in the sandbox, so to speak, and cannot do any damage. That already has its charm.

A virtual machine with VirtualBox is another good option. However, you then have to rely on FreeDOS. This has to do with the data exchange between host and guest. For very
special cases I can start a pure DOS from an USB stick.

Quote from: zedd151 on December 29, 2022, 03:08:47 PM
As a side note... I had to google 'tracery' as I had not heard that term before, iirc. You just added to my vocabulary.  :biggrin:  And to think I thought it was a typo at first.

Well, the word is not so often used and probably comes from ancient times, but it is quite common for these circumstances. There are: branch traceries, frost traceries or
plate traceries, for example. Anyway, my paper at least helped expand your vocabulary. :cool:

By the way, have you already found the linear equation system to solve the problem?
You have to know the facts before you can distort them.

zedd151

Quote from: Gunther on December 30, 2022, 12:36:50 AMthat's a pretty big effort for a short test run.

Actually not a big deal. Takes ten minutes sometimes a little less (win 7) to reinstall from a .wim image  :cool:  I generally leave one partition available for OS changes when needed. Either Windows xp 32 bit, windows 7 32 bit and 64, or windows 10 64 bit.  :tongue:  Windows xp reinstalls very quick ~5 minutes, windows 10 maybe 20 minutes.
Quote
By the way, have you already found the linear equation ...


A little beyond my skill set and pay grade.  :biggrin:

FORTRANS

Hi,

Quote from: Gunther on December 29, 2022, 02:31:20 PM
Test results from other members would be very nice. I would also welcome some feedback on the readability of the document mw.pdf. Thank you in advance.

   The program runs with a Win2000 NTVDM.  The PDF reads quite well.
Amusingly, the problem looks like calculus might be easier to set up
rather than a geometric solution.  (Well maybe, maybe not.)

Regards,

Steve N.

daydreamer

great :thumbsup:
works in Dosbox
frost traceries?like if swedish ice hotel artist carves those shapes in the ice?
me often want to use formulas to draw things in code ,expected some image drawn by curves?
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

Gunther

zedd151

Quote from: zedd151 on December 30, 2022, 02:36:41 AM
A little beyond my skill set and pay grade.  :biggrin: [/font]

You're understating the case. It's really not that difficult.

Steve,
Quote from: FORTRANS on December 30, 2022, 02:46:52 AM
   The program runs with a Win2000 NTVDM.

Good to know. Thank you. :thumbsup:

Quote from: FORTRANS on December 30, 2022, 02:46:52 AM
The PDF reads quite well.
Amusingly, the problem looks like calculus might be easier to set up
rather than a geometric solution.  (Well maybe, maybe not.)

Here I must clear up a misunderstanding. The drawings, or rather sketches, are only intended to help you set up the equations. There are 3 unknowns x, y and z. Therefore, we need 3 equations
to determine their values. From the picture in the PDF document you can immediately identify 2 equations. For the necessary third equation, further considerations and an additional sketch are
required. Then you have the linear equation system, which is easily solvable.

I think that there is no geometric solution for this question, since we are looking for partial areas. Of course, your remark is correct that integral calculus can be used to solve it. But this could be
associated with certain difficulties. We have quarter circles. In Cartesian coordinates, roots would then appear in the integrand. A transformation to plane polar coordinates could help. To determine
the integration limits, the 4 circle equations must be set up and the corresponding intersection points calculated. This is not exactly elementary either. Finally, the 3 integrals must be calculated.
In this time, the linear equation system has long been solved and the results of both calculation methods will match.

My view of the things is like this: Use integral calculus where it is necessary. However, if there are simpler and equivalent alternatives, they should be applied. We should also remember that: In the
Renaissance, when this task was first given, the ancient builders did not yet know about the infinitesimal calculus. Nevertheless, the practical problem was successfully solved.

daydreamer,

Quote from: daydreamer on December 30, 2022, 03:44:54 AM
great :thumbsup:
works in Dosbox

Thank you for testing.

Quote from: daydreamer on December 30, 2022, 03:44:54 AM
frost traceries?like if swedish ice hotel artist carves those shapes in the ice?
me often want to use formulas to draw things in code ,expected some image drawn by curves?

I was thinking more of ice flowers and snowflakes. Fractal curves - like the Koch curve - are probably better suited to describe such shapes.

I only have the solution handwritten so far and have yet to convert it to an electronically readable form. I am currently tutoring 8th grade learners at a high school
in Brandenburg, Germany. In the second half of the school year (April, May), linear equation systems will be taught. I will set this task as a longer term homework
project. That's why I won't publish the solution here. Students are very creative when it comes to searches in the Internet. But who is interested in the solution,
can send me a PM with a mail address. As soon as the solution is available as a file, I will transmit it this way.
You have to know the facts before you can distort them.

zedd151

Quote from: Gunther on December 30, 2022, 05:06:39 AM
... It's really not that difficult ...
Hi Gunther,
If I have some free time, I'll look at it later at some point...

Gunther

zedd151,

Quote from: zedd151 on December 30, 2022, 05:24:51 AM
If I have some free time, I'll look at it later at some point...

Yes, it's worth a look.
You have to know the facts before you can distort them.

HSE

Hi Gunther!

There is a nice geometric solution:

Математика и фокусы:  https://www.youtube.com/watch?v=fLRBiPJhmdo

Code ( Masm64) Select
y = 2.7118e-001
z = 1.9697e+000
x = 7.9890e-001

matematika_i_fokusy = 6.2500e+000

gunther = 6.2501e+000

Press any key to continue...


Regards, HSE
Equations in Assembly: SmplMath

Gunther

HSE,

Quote from: HSE on December 30, 2022, 06:57:49 AM
There is a nice geometric solution:

I think not. The geometry is only used to derive the equations. This is what I have already described above:
Quote from: Gunther on December 30, 2022, 05:06:39 AM
Here I must clear up a misunderstanding. The drawings, or rather sketches, are only intended to help you set up the equations. ...

A strictly geometric solution would mean to determine the area with circle and ruler. How is this supposed to work? I'm glad my students don't know Russian. But why doesn't the presenter
say anything about the history of the exercise and why is he yelling like that? Is that really necessary?
You have to know the facts before you can distort them.