Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The test of intelligent tinkering is to save all the parts. -- Aldo Leopold


devel / comp.lang.tcl / I need help with basic math

SubjectAuthor
o I need help with basic mathLuc

1
I need help with basic math

<20221113102648.0c657a32@lud1.home>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10138&group=comp.lang.tcl#10138

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!ac6OoMHkWYPV8qf+a92lSg.user.46.165.242.75.POSTED!not-for-mail
From: no...@no.no (Luc)
Newsgroups: comp.lang.tcl
Subject: I need help with basic math
Date: Sun, 13 Nov 2022 10:26:48 -0300
Organization: Aioe.org NNTP Server
Message-ID: <20221113102648.0c657a32@lud1.home>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="38727"; posting-host="ac6OoMHkWYPV8qf+a92lSg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-Newsreader: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu)
 by: Luc - Sun, 13 Nov 2022 13:26 UTC

I intend to ressuscitate another very old project of mine written in Tcl
that I never published. This one performs tests on multiple file systems,
measures the performance of each one then prints a bar chart with the
comparison of all tests. The core code is all done, has been for over a
decade, and it successfully prints the charts in HTML.

But I want to fancy it up this time. I want to print the charts in Tk canvas
widgets. Maybe even add a little interactivity. I will see about that.
I'm not looking at any chart code on the wiki or the Internet. I want to learn
about canvas along development of the project. It's supposed to be educational.
I sketched something very rough and my big struggle is not with Tcl/Tk, but
with the math. I've never been good at math.

For the large view, I have decided on an area of 900 pixels high and at least
1800 pixels wide. I can afford more. Scaling that size for different screen
sizes and resolutions will be another problem later. The small view will be an
easy fraction of the large view, e.g. 900 -> 90 or 900 -> 180.

Anyway, I am mostly concerned with height right now. I want to have a vertical
ruler with marks on the side of the chart. Each chart will have maximum and
minimum values. I want those values in the ruler to be reasonably round, for
example in increments of 10 or 50 or 100. Something like that. But the chart
bar values will rarely be round. Not only that, they will vary a lot in
magnitude. One chart will measure minutes and seconds, another chart will
measure Megabytes or Gigabytes, another chart will count the number of files
or remaining free space, and so on. With all that in mind, everything in every
chart has to look reasonably about the same size.

So my question is, how do I enforce some kind of universal measure that will
translate raw values into proportional screen real estate units?

Also, the vertical ruler has labels so its maximum value is actually 20 pixels
under the 900-pixel border so there is room for the label to sit on top of it,
but that will certainly vary because I always write my applications to allow
easy customization of visual elements such as font face and size, colors etc.
If the user changes font size, that "attic" size will change too.

It's not really a Tcl question, it's a math question. I hope I'm not asking
too much. Thank you for any help as usual.

I wish you all a happy Sunday and a prosperous week.

--
Luc
>>

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor