Updated 2018-03-17 23:13:52 by gold

Hi, I'm an old fortran programmer trying to retread. I actually served time on the IBM punch card machines. I collect old fortran books as a hobby. A lot of guys leaving work would give me their old fortran books or sit them by the trashcan. Also I programmed a lot in Javascript. Mostly i work on TCL now because i am visually oriented and think gui can save a lot of time.

14Apr2016. When I first came to the Tcl Wiki, images were required to stored off site to save storage space. I note some of the older image off_sites are powering down and I need help or explanation_how_to page on how to store images at this Tcl Wiki site. I stored some test images, but could not link to them from the wiki page. I spent a lot of time on this website and it seems a shame to lose the Tcl efforts. I'm sure other wiki voyagers are in the same boat. Thanks for any help in rescuing existing offsite images. APN Please see the section on Images in the Formatting Rules page for instructions on how to store and link images on the wiki. gold later on 21apr. I'm going to cut many of my references to offsite images. Can't easily retrieve some images and not sure images add that much. I'll restore what I can. Would like some specifications or suggestions of image type (png etc) and usefull byte size, since have seen arguments on use of jpegs on TCL WIKI.

gold Oct_2017. About 1996, the PC on my desk, was replaced by a Sparc 20 workstation. I was an engineer and mainly programming in Fortran. I had learned QuickBasic, also. Since the Sparc 20 interface was command line Unix, I looked around for a gui or gui language as an interface to the Sparc 20. I found TCL fairly easy to mouse click and invoke executable icons on the Xwindows screen. I also wrote small slot calculators in TCL and Javascript, which were similar to my later wiki pages. Never forget the human brain evolved to hunt rabbits, not Unix critters and command lines. Your eyes and brain modeling/mapping of the outside stims are closer to a gui screen than one might think.

from ask 12 Ask, and it shall be given # 12

Broken images

HJG 2015-05-20: There are a lot of wiki-pages with broken images,
because external links have expired (many of them from user gold). Does the wiki have a way to check for this, and make a list ?

gold1may2016,Thanks for your help in restoring offsite images. I'm going to cut many of my references to offsite images. Can't easily retrieve some images and not sure images add that much. I'll restore my offsites into onsite WIKI storage, what I can. Would like some posted (approved consensus) specifications or suggestions of image type (png or gif) and usefull byte size on the how_to page. Since have seen arguments on use of jpegs and fuzzies on TCL WIKI. There are some search key words that will pull the older images.

from Ask, and it shall be given # 12, treating extended lines with pretty print [gold ]- 2017-01-20 I have been using ased editor for some code on my wiki pages. When the tcl lines with extended lines , the code is garbled/will not compile. Can someone direct me to a PC based editor that will handle extended lines or help me clean up some of my wiki pages in their own editor? Refrigerator_Pinyin_Poetry Random Poetry Chalkboard Chinese Xiangqi Chessboard has extended and empty lines. Can ASED delete empty lines? Maybe, I have an old version.Thanks in advance.

gold- 2017-12-9 filled ticket with Sourceforge.
subj. start-up, paste, and extra long comment lines.
 Recent dec 2017 errors
 1.on initial startup
 2. and also paste file
 3. On my TCL WIKI files, I have some extra long comment lines,
 4. which become corrupt when i use autoident.
 4. thanks, i have been using ased editor on my wiki pages for 7 years or so.
 5. But i really need to process these wiki scripts with extra long lines (> 200, start with #).
 screen log output
 can't read "start": no such variable
 can't read "start": no such variable
 while executing
 "$TxtWidget index $start"
 (procedure "editorWindows::paste" line 50)
 invoked from within
 "editorWindows::paste"
 (procedure "Editor::paste" line 4)
 invoked from within
 "Editor::paste"
 (menu invoke)

from Ask, and it shall be given # 12,

gold Many complex math programs have either initialize, refresh, or reset routines to force correct behavior. Most of my canvas programs on this wiki have this feature (on changing labels and resetting variables prior to calculations). Where the program defaults and canvas colors/features/clear displays are reset prior to (push button) calculation. This tactic should work across TCL versions, at least in the several versions I test (eTCL,TCL8.5, and TCL8.6).
 ::ttk::button .test4 -text "Testcase3" -command {clearx;fillup 120. 12.0 15.0 1.  1.  1. 1. 104.0 }
  button  .b3 -text "castle"   -command {clrcanvas .cv;barley .cv 20; castle  .cv; }
  button  .b8 -text "S.board"   -command { refreshgridx .cv  }

Page contents

Projects


test below
Babylonian Sexagesimal Notation for Math on Clay Tablets in Console Example
Binomial Probability Slot Calculator Example
Biruni Estimate of Earth Diameter Slot Calculator eample
Chinese Fortune Casting Example Demo
Chinese Sun Stick Accuracy for Console Example
Command Line Calculator in Namespace Package Example
Crater Production Power Law Slot Calculator Example
Drake Intelligent Life Equation Slot Calculator Example
Easy Eye Calculator and eTCL Slot Calculator Demo Example, Numerical Analysis 
Ellipse Properties Slot Calculator Example
Fuel Cost Estimate Log Slot Calculator Example
Generic Calculator Namespace Package Example
Heat Engine Combustion and Calculator Demo Example
Human Language Root Words & Lexicostatistics Calculator and eTCL Slot Calculator Demo Example, numerical analysis
Mahjong_Style_Deletion
Oil Molecule Length Calculator and eTCL Slot Calculator Demo Example, numerical analysis
Oneliner's Pie in the Sky
Paper & Felt Rolls and eTCL Slot Calculator Demo Example
Penny Packing Calculator and eTCL Slot Calculator Demo Example, numerical analysis
Piece wise Profits and eTCL Slot Calculator Demo Example 
Planet Mass Calculator and eTCL Slot Calculator Demo Example, numerical analysis
Poker Probability and Calculator Demo Example
Random Walk Equation Slot Calculator Example
Rectangular Radio Antenna and etcl Slot Calculator Demo Example
Sanskrit Number Words Handling in Formulas and Demo Calculator Example
Sea Island Height Slot Calculator Example
Seaching for Babylonian Triplets Slot Calculator Example
Simple Reliability Slot Calculator Example
Slot_Calculator_Demo
Stonehenge Circle Accuracy Slot Calculator Example
Stratographic Years Slot Calculator Example, Age of Earth
Sumerian Equivalency Values, Ratios, and the Law of Proportions with Demo Example Calculator
Sumerian Beveled Bowl Volume and eTCL Slot Calculator Demo Example 
Sumerian Circular Segment Coefficients and Calculator Demo Example
Sumerian Coefficients at the Bitumen Works and eTCL Slot Calculator Demo Example edit
Sumerian Coefficients at the Weavers Factory and eTCL Slot Calculator Demo Example 
Sumerian Coefficients in the Pottery Factory and Calculator Demo Example
Sumerian Construction Rates and eTCL Slot Calculator Demo Example
Sumerian Paint & Bitumen Coating and eTCL Slot Calculator Demo Example 
Sumerian Population Density and eTCL Slot Calculator Demo Example 
Tonnage of Ancient Sumerian Ships and Slot Calculator Demo Example

AMG: Please note that in this Wiki, spaces at the beginning of the line interfere with proper formatting.

What is the meaning of your "#start of deck" and "#end of deck" comments in your code examples? And why do you need a plural set of the comments at the start and end?

gold Like i said, I'm an old Fortran programmer. The multiple start and stop statements including subroutine stop and return statements were used in scanning big reams of Fortran code with 10E5+ lines. I can tell you that obvious stop,end,and return statements are helpful in that size of code. Come to think of it, I have seen lots of TCL wiki code with out end statements, obvious exit paths,obvious return statements, and graphic displays without exit buttons. The advantage of the wiki is that people can cut and paste what they want to use.

Ah, I see. Also, consider that maintaining a consistent code indentation and spacing can help immensely when scanning a block of code, and not just at the start and end of the chunk. Compare the before and after code look here: Example Linear Interpolation Calculator

Much of the wiki code is examples, and many times keeping an example focused on the example, without extras, makes for a clearer presentation. As well, modern GUI's provide out of band exit methods (the X in the mswin title bar, etc.) such that a lack of an exit path and/or exit button does not result in an unrecoverable situation. When the OS already provides a default "exit method" to every running program (and one or more out of band "kill" systems) there is less of a need to include an explicit exit in the code of each program.

aspect The amount of code you're pumping out in here is impressive, and I find some of the topics very interesting, but I'm finding the presentation less than useful. A few pointers, which I hope should be of value to yourself as well as anyone reading (and considering contributing) to your pages:

  • Try to keep the wiki content example-focussed. Having multiple versions of the same long program in one page is distracting and confusing. If you need an online repository for your code I'd suggest using http://github.com/ keeping the wiki page for interesting extracts others can learn from or comment on.
  • Please be consistent with indentation and formatting! Your code will become much more readable to others and easier to maintain for yourself. The Tcl Style Guide (start with the linked PDF) is a good place to start.
  • Wherever you can, breaking out shared functions into a separate library script that can be loaded via source (or better yet package require), will make the library more solid and the main program more readable.
  • If your explanatory commentary can be moved closer in the page to the code it concerns, that will also aid readability. Use inline comments (#) or the "if 0" trick -- an example is diff in tcl

Finally, going mostly by the screenshots (I admit I find the code hard to follow -- see point #2), many of your examples seem to have a common presentation, with a similar GUI consisting of:

  • a set of labelled boxes for user input
  • a "Solve" button which calls your main logic with the inputs as arguments
  • a few "Testcase" buttons to illustrate examples and test the code
  • "About", "Clear" and "Exit" buttons

I for one would love to see the GUI side of the code factored out into a common framework which each example could share. That way the wiki page for each calculator example could be focussed on the logic, looking something more like this:
namespace eval linear_interp {
  set name "Linear Interpolation Calculator"
  set inputs {"First X value" x1 "First Y value" y1 "Second X value" x2 "Second y value" y2 "Solve for x" xx}
  set about "This is Gold's linear interpolation calculator, © 2011
  .. with some more information on how it works and is used, etc"
  set testcases {
    {10. 10. 200. 50. 123.}
    # etc
  }
  proc calculate {x1 x2 y1 y2 xx} {
    return [expr {some magic here to calculate the result}]
  }
}
load generic_calculator_gui.tcl
generic_calculator_gui linear_interp

As a secondary advantage, your calculator could then without modification be used in other contexts, such as a command line or web tool or automatically invoking all the test cases. Of course, the GUI can also be easily re-skinned to the user's preferences without impacting the main code.

I hope you don't find the above overly critical or discouraging, that's certainly not my intention -- but I do think keeping the above points in mind will make your pages more appealing to other wiki'ers and encourage collaboration .. which is what we're all here for, after all!

gold pasted trial namespace at bottom of [Drake Intelligent Life Equation Slot Calculator Example]

gold Procedures for pretty print on tcl wiki. Found website for removing blank lines online etc(free).One can paste wiki text into the (free) rough-draft editor and get a spell-check. Ased is free editor that has pretty print for TCL scripts.

Any decent programmer's editor should allow you to search and replace on any character in the file you are editing. To remove blank lines (provided they do not contain spaces) just search for two adjacent line ending characters and replace them with one line ending character. I choose to say "line ending character" on purpose, the "line ending character" differs between Unix, Mac, and Windows. If the editor supports regular expression search (many do) then you can also delete lines that contain white space by using a suitable regular expression.

large number values from sumerian,babylon,cuneiform math from clay tablets

kilometers,degrees etc are modern equivalents

decimal /logo transliteration nindanmodern kilometers modern degrees latitudemuseum tablet no.
10danna180001080.970A30211
11danna19800118.81.067A30211
12danna21600129.61.164A30211
13danna23400140.41.261A30211
14danna25200151.21.358A30211
16danna28800172.81.552A30211
17danna30600183.61.649A30211
18danna32400194.41.746A30211
19danna34200205.21.843A30211
19danna34200205.21.843A30211
20danna360002161.940A30211
30danna540003242.911A30211
40danna720004323.881A30211
50danna900005404.851A30211
60danna1080006485.822A30211
70danna1260007566.792A30211
100danna10809.71924.1278
1 me lim gur 1E5300E5 litersA1924.1278
9 me lim gur 9E52700E5 litersA1924.1278
1 lim lim gur 1E6300E6 litersA1924.1278
12960000no_units60E4 x10 Greek feet= 40 046 400 meters
12960000no_unitsbritish museum
(10 x 60**2) x 60no_units1296000012960000 * 10 * .309 (reed gi) = 40046400 metersIdlib Museum,Syria,C2
no_units1296000012960000 * 10 * .303 (japanese jo) = 39 268 800 metershttp://en.wikipedia.org/wiki/Japanese_units_of_measurement
70*(60**7)no_units1.95955E14nippar text

12 960 000 * 10 * .309 = 40 046 400 (greek feet)

(10 x 602) x 60
 12960000 * 10 * .309 = 40 046 400
  The ratio of a japanese rin to a ri is 10/12,960,000
  The ratio of a japanese shaku to a ri is 6/12,960
  The ratio of a japanese bu to a ri is 10/1,296,000
 a shaku is effectively a japanese foot
  a ri is effectively 3.9 km

  36*60=2160
  30*60=1800
  5/6  = 1800/2160
  129600 * .309 * factor = 40046.4
  sumerian foot  129600 * .333 =
  129 600 * .333 = 43 156.8
 12 960 000 * .333 * (11 / 12) = 3 956 040

Note that as you say above that you are using Tcl 8.5.6, then Tcl 8.5 already contains a built-in "lreverse" command, so your proc "lreverse5" above could be deleted, and calls to "lreverse5" can be replaced by calls to the built-in "lreverse" command.

gold Changes. Removed proc lreverse5 and using 8.5 lreverse command. Proc sexagesimalfraction not working right.

The change from lreverse5 to built in lreverse does not appear to be the cause:
% set list [ list 5 3 1 8 9 4 7 ]
5 3 1 8 9 4 7
% proc lreverse5 {l} {
            # KPV
            set end [llength $l]
            foreach tmp $l {
                lset l [incr end -1] $tmp
            }
            return $l
        }
% lreverse5 $list 
7 4 9 8 1 3 5
% lreverse $list
7 4 9 8 1 3 5
% 

The result from lreverse5 and the built in lreverse are identical. Note that you did not change one call in sexagesimal to use the built in lreverse.

The stonehenge audrey holes seem to measure 0.5 degrees. At least some stone circles have a diameter of 32 meters and appear to measure 6/360 part of the sky. Some of medicine wheels in North America have divisions of 28.

Special solar/lunar octagon table

quantity
stone circle/structureazimuthunitsaccuracyunitsangular delta(abs)unitswebsite
Northern major standstill Moon rise - 58 degrees0.3degrees65.5degreeshttp://en.wikipedia.org/wiki/Stone_Henge
Southern major standstill Moon rise - 123.5degrees0.3degrees65.5degreeshttp://en.wikipedia.org/wiki/Stone_Henge
Southern major standstill Moon set - 236.5degrees 0.3degrees65.5degreeshttp://en.wikipedia.org/wiki/Stone_Henge
Northern major standstill Moon set - 302 degrees 0.3degrees65.5degreeshttp://en.wikipedia.org/wiki/Stone_Henge
Southern major standstill sun set -133degrees0.3degrees degreeshttp://en.wikipedia.org/wiki/Stone_Henge
Northern major standstill sun rise - 44.7 degrees 0.3degrees degreeshttp://en.wikipedia.org/wiki/Stone_Henge

Azimuth Plotting

First Example

Calculator with big fonts for bad eyes and used on my computer windows desktop. Console show provides the console and a paper tape record of calculations, which can be cut and pasted to a word processor like notepad. Also, program is good example of namespace.
                  # autoindent from ased editor
                  # program " 2 Line Calculator in Namespace"
                  # written on Windows XP on eTCL
                  # working under TCL version 8.5.6 and eTCL 1.0.1
                  # TCL WIKI , 25may2011
                  namespace path {::tcl::mathop ::tcl::mathfunc}
         package provide calculatorliner 1.0
            namespace eval liner {
                proc initdisplay {} {
                    pack [entry .e -textvar e -width 50 ]
                    bind .e <Return> {catch {expr [string map {/ *1./} $e]} res; set e $res} ;# RS & FR
                }}
            proc linershell {} {
                namespace import liner::*
                liner::initdisplay
                .e configure -bg palegreen
                .e configure -fg black
                .e configure -font {helvetica 50 bold}
                .e configure -highlightcolor tan -relief raised -border 30                                   
                focus .e
                button .b -text clear -command {set e ""} 
                button .c -text exit -command {exit} 
                pack .b .c   -side left -padx 5
                . configure  -bg palegreen
                wm title . "Suchenwirth 2 Line Calculator"
            }
            console show
            linershell

In some of the Sumerian literature, the constants for gold are called tube of gold or kus of gold, which possibly refer to a wire or rod. The Sumerians were experts at gold wire jewelery and used wire etc for trade in the early days. For example, the gold constant was 1:48 or decimal 108 in unspecified units. From modern estimates of density, a gold rod of 1mm diameter about a cubit (50cm) would have 0.15158 modern grams per cubit or 0.904 gin per cubit. There were about 8.3 metric grams in a Sumerian shekel or gin. Prospective formula is alpha times circumference squared equals 2 sila. sexagesimal 4:48 or decimal 288 is reciprocal 0;0,12,30 or decimal 12/3600+30/216000. alpha*circumference squared eguals 2 sila. height is circumference * sqrt(thickness/alpha) 1mm diameter silver wire of one cubit length .7854 * 10.5 gm/cc = 0.08246 gm/cm 0.08246 gm/cm, mass/length 0.08246 gm/cm (1gin/8.33grams) (49.7 cm/cubit) = 0.491 gin/cubit or sexagesimal 0;30 gin/cubit 288/6300=0.04571 gin/nindan 12*288/6300 equals 0.548 gin/cubit constant has units nindan*nandin/( volume in sar) formula is area*density=mass/length

In some of the Sumerian literature, the constant for gold are called tube of gold or kus of gold, which possibly refer to a wire or rod. The Sumerians were experts at gold wire jewelry and used wire for trade in the early days. Several remaining tablets give coefficients for the metals and the thickness of coefficient. For example, the gold constant was 1:48 or decimal 108 in unspecified units. From modern estimates of density, a gold rod of 1mm diameter about a cubit (50cm) would have 745.75 modern grams per cubit or 82 Sumerian grains per cubit. Normally the Sumerians measured gold, silver, and electrum in shekels or gin. There were about 8.3 metric grams in a Sumerian shekel or gin. The thickness of log coefficient is sexagesimal 4:48 or decimal 288. The reciprocal thickness of log coefficient is 0;0,12,30 or fraction 12/3600+30/216000, or decimal 0.003472 . An ancient math problem ref. Thoureau Dangin helps define the log thickness coefficient on a cylinder as the thickness of log coefficient (alpha) times circumference squared ( 0;25 or fraction 25/3600) equals the answer ( 2 sila). From inference on the math problem, the units of alpha are sila/(nindan*nindan) or volume per length*length. This method sets up a reference unit on the cylinder such that one nindan of the cylinder length approximates 2 sila. For example, the ratios for a half nindan length would be 1/2 nindan/1 nindan is as 1 sila to 2 sila. This method would have a possible use in breweries, a nindan stick and the circumference of the vat could used to find volume in a vat of beer. Continuing further with other uses for the thickness of log coefficient, the volume per length times density or mass per volume gives mass per length. Dividing the thickness constant by the gold constant gives the gin per unit length or gin per nindian. Multiplying by twelve gives the gin per cubit.

Although subject to interpretation of Sanskrit text, the Sanskrit number words were used in Vedic formulas which are prologues to the atomic theory. #developed from instances of zero/error handling in the calculators on this TCLwiki.For example, an attempt to divide by zero will produce an error (1/0). In numerical analysis, erratic conditions can develop from subtracting a set of nearly equal numbers or very small numbers approaching precision limits (1.002-1.001 or 0.00002 - 0.00001 or [1.002-1.001]/[0.00002 - 0.00001] ). If divide by zero is a problem error, sets of numbers may contain zero values or numbers that approach zero value from the negative side (eg. 0.0001,0.0002,-0.0001,0.0003). Also, clipping,quantization, or reduction of real numbers may produce zero. values ( eg. 0.0001 at precision .02 clips to zero).Errors can be avoided using control ps for testing division by zero, offsetting numbers from zero, deleting zeros from sets of numbers, or atleast warning the operator that the calculations are approaching erratic conditions.

For the push buttons, the recommended procedure is push testcase and fill frame, change entries , push solve, and then push report. Report allows copy and paste from console, but takes away from computer "efficiency".

In planning any software, there is a need to develop testcases.

Testcase 1.

  operation    result
  1/0          Inf, defined as error condition here   0/0
  0/1          zero, defined as correct

  Testcase

The Indian astronomy texts of 620 CE. used multiple Sanskrit words for zero (and numbers 1-9). The Sanskrit aternate words for zero were kha,ambara,akasa,antariksa,gagana,abhra,viyat,nabhas,sunya,bindu.The Sanskirt word sunya (void) is more common in the online wordlists. In transliterated Sanskrit , the decimal number 1000 could be expressed as left to right (0001) viyad(sky or zero)/ambar(atmosphere or zero)/akasa(space or zero)/eka(1). #Trying to find some earlier estimates of atomic theory from other cultures. The Svetasvatara Upanisad of Vedic literature indicated an atman was one ten thousanth of the diameter of a human hair, expressed as (1/00)*(1/100). or 10-4 .A human hair averages 80 microns or 8E4 nanometers.An atman would be 8E4/1E-4 or 8 nanometers. Since an insulin molecule is 5 nanometers and a hemogoblin molecule is 6 nanometers, an atman of 8 nanometers compares to human molecules within an order of magnitude.Possibly, the Sanskrit word atman (soul) was derived from atman (breath) and in some texts the root word ama (mother) seems associated or used as meaning soul. The Sumerians used oil films in bowls for divination purposes under tutoring of gods Enhil, Enki, and Ea, ref WG. Lambert (Enmeduranki,pg115). Early reference to atomic theory in English.It is as easy to count atomies as to resolve the propositions of a lover. Shakespear,As You Like It " 1590 CE. This Shakespear quote is believed to be derived from the Roman Lucretius, 20 CE.
 set sanskritword "1 2 3 4 5 6 7 8 9 0 , . / +"

eka dvi tri catur panca sat sapta asta nava sunya , . / + 1% dvinavaambarasatambarapancanavaastaasta 1%

Oil Molecule Length, Slot Calculator Example \

This page is under development. Comments are welcome, but please load any comments in the comments section at the middle of the page. Thanks,gold

20 drops = 1 milliliter 1 drop = 0.05 milliliter gold Here is an eTCL script to estimate the length of an oil molecule.
        # pretty print from autoindent and ased editor
        # oil molecule equation
        # written on Windowws XP on eTCL
        # working under TCL version 8.5.6 and eTCL 1.0.1
        # gold on TCL WIKI , 20jan2012
        package require Tk
        frame .frame -relief flat -bg aquamarine4
        pack .frame -side top -fill y -anchor center
        
        set names {{} {initial drop volume mm3} }
        lappend names {diameter oil slick millimeters:}       
        lappend names {number of atoms}
        lappend names {answer nanometers:}
        lappend names {answer nanometers:}
        foreach i {1 2 3 4 5 } {
            label .frame.label$i -text [lindex $names $i] -anchor e
            entry .frame.entry$i -width 35 -textvariable side$i
            grid .frame.label$i .frame.entry$i -sticky ew -pady 2 -padx 1
        }
        proc about {} {
            set msg "Calculator for Oil Molecule Dimension .
            from TCL WIKI,
            written on eTCL "
            
            tk_messageBox -title "About" -message $msg
        }
         proc pi {} {expr acos(-1)}

        
           proc calculate {     } {
            global answer2   
            global side1 side2 side3 side4 side5 
            set term1 0
            set term2 0
            set term3 0            
 set height  [ expr {  (4.*$side1*1E6)/([pi]*$side2*$side2)  } ]
            set side4 $height
            set side5 [ expr { ($side4/$side3)} ] 
            return $side5
            
        }
        proc fillup {aa bb cc dd ee } {
            
            .frame.entry1 insert 0 "$aa"
            .frame.entry2 insert 0 "$bb"
            .frame.entry3 insert 0 "$cc"
            .frame.entry4 insert 0 "$dd"
            .frame.entry5 insert 0 "$ee"            
        }
        
        proc clearx {} {
            foreach i {1 2 3 4 5 } {
                .frame.entry$i delete 0 end
            }
        }
        
        proc reportx {} {
            global side1 side2 side3 side4 side5 
            console show;
            puts " $side1     "
            puts " $side2    "
            puts " $side3    "
            puts " $side4    "
            puts " $side5    "
            puts "answer   $side5 "
        }
        
        frame .buttons -bg aquamarine4
        
        ::ttk::button .calculator -text "Solve" -command { calculate   }
        
        ::ttk::button .test2 -text "Testcase1" -command {clearx;fillup .005 60. 12. 1.76 .17 }
        ::ttk::button .test3 -text "Testcase2" -command {clearx;fillup .065 220. 12. 2. .17 }
        ::ttk::button .test4 -text "Testcase3" -command {clearx;fillup .125 280. 12. 2. .17 }
        ::ttk::button .clearallx -text clear -command {clearx  }
        ::ttk::button .about -text about -command about
        ::ttk::button .cons -text report -command { reportx }
        ::ttk::button .exit -text exit -command {exit}
        pack .calculator  -in .buttons -side top -padx 10 -pady 5
        
        pack  .clearallx .cons .about .exit .test4 .test3  .test2   -side bottom -in .buttons
        grid .frame .buttons -sticky ns -pady {0 10}
        . configure -background aquamarine4 -highlightcolor brown -relief raised -border 30
        wm title . "Oil Molecule Dimension Calculator "

There are coefficients for concave square figures, which are of uncertain shape. These coefficients of transverse length 1 and area coefficient 0;26:26 or 0.43988. For a unit circle inscribed inside a unit square, the total area of the bits in the four corners is (area of square) - (area of circle), 1*1-.5*pi*.25*.25, 1-0.78539, decimal 0.2146. For a possible area formula, area is constant*transverse*transverse, 0.43988*1*1 or 0.43988 area units. Hence, eight of the corner bits or 2*0.2146 or 0.4292 would be closer to the formula result. Other coefficients and possible other geometric figures refer to short transverse of 0;33,20 (decimal 0.5555) and long transverse of 0;48 (decimal 0.8) with an area constant of 0;53,20 (decimal 0.8888) and a concave triangle of 0;15. For a possible area formula, area is constant*transverse*transverse, 0.8888*.8*.8 or 0.5688 area units. If a generic formula for is N1 * s. transverse * l. transverse equals area units, then rearranging terms gives N1 equals s. transverse * l. transverse / area units. N1 = 0.5555*0.8/0.5688 or 0.78. The simple shapes such as triangles, rhombus, and trapezoids usually have a factor of 1/2 involved. One can factor out 0.78 as 1.56 * 0.5 or even (pi/2) * 0.5 for a semicircle. What about an hourglass figure with 2 back to back concave?

Some of the ship constants range from sexagesimal 0:05 to 0:12 or decimal fractions 5/60 to 13/60. The reciprocal constant for the Akkadian long ship (elippi or elonga type) was listed as 0;07:13.The ship constant times ship length cubed gives ship volume. The ship constant times ship length cubed times density gives ship mass (eg. cargo mass).

In planning any software, it is advisable to gather a number of testcases to check the results of the program.
pseudocode: enter ship length,ship constant,density
pseudocode: ship constants of 5/60, 6/60, & 7/60 fractions    
pseudocode: answers are ship volume, cargo mass
pseudocode: go/ no_go condition
  (7/60)* [(ship length)**3]  = 0.1166 cubic units 
  (7/60) *[ 1 cubit**3] * 740 kg/[cubits**3] = 74    kilograms
  If cargo mass is greater than ship b., flag go/no go .

Testcase 1.

The trading ship hull has a length of 18.3 meters, beam of 3.96 meters, and a body height of 1.82 meters. With normal loading, the draw is 0.914 meters and the freeboard is 0.914 meters. The displacement is 30,000 kilograms with a hull weight estimated at 10,000 kilograms. The float or potential cargo is 20,000 kilograms. The surface area of the deck was estimated to be 46.4 square meters. The perimeter of the entire deck was estimated to be 44 meters. The arclength on one side of the deckship arclength is 22.65 meters or 45.57 kus, which was used in Sumerian calculations. Allowing for crew, spare consumables, and equipment at 8,000 kilograms, this is believed to be a "20 gir ship" with a cargo of 12,000 kilograms, 6000 liters (= 20 gir units), or 12,000 rations of grain. The normal ship crew is 30 rowers, 4 steermen, and 3 officers for a forty day cruise. Two rowers each are assigned to a 20 foot oar. Also, there are 2 steering oars at the back of the ship. Under oars alone, the trading ship has a speed of 6000 meters per hour. Under sail alone and ideal conditions, the speed is 160 kilometers per day or average 6600 meters per hour. However, the trading ship is rarely under power at night.
0.5*18.3*3.98=36.4 sq meters
deck area 36.4  sq. meters
radius figure  12.727922 meters
ship arclength is 22.65 meters or 45.57 kus.
trading ship is 64 gurs by modern rating formula.
liter wheat = 0.78 kg
liter barley = 0.62 kg
constant*sq. deck area = silas?
 7/60 * 371 * 371 = 16058 silas, 
16058 silas * 1 gur/300 sila = 53 gur
95 sq.cubits*95 liters sq cubit/300 liters/gur
=30 gurs

Testcase 2.

The grain storage ship has a length of 29.2 meters, beam of 9.7 meters, and body height of 3.96 meters. The deck area of the grain ship approximates 0.5*29.5*9.7 or 143 sq meters. The grain ship arclength is 36.14 meters or 72.7 kus. The displacement is 245,000 kilograms with a hull weight estimated at 82,000 kilograms. The float or cargo is 163,000 kilograms. The storage ship allows for crew at 6,000 kilograms, spare consumables at 73,000 kilograms, and equipment at 48,000 kilograms. The storage ship is believed to be a "60 gir ship" with a cargo of 36,000 kilograms, 18,000 liters (= 60 gir units), or 36,000 rations of grain. The normal ship crew is 50 rowers, 5 steermen, and 5 officers for a ninety day cruise. Under oars alone, the storage ship has a speed of 4000 meters per hour. Under sail alone and ideal conditions, the speed is 160 kilometers per day or average 6600 meters per hour. There are 2 steering oars at the back of the ship. The grain ship hull has a length of 25 meters, beam of 6 meters, and a body height of 4 meters. With normal loading, the draw is 2 meters and the freeboard is 2 meters.
grain ship: 58.4 cubits
935 sq cubits.
59.1 cubits long
grain ship arclength is 36.14 meters or 72.7 kus.
grain ship is 585 gur, by modern formula
deck area of grain ship approximates 0.5*29.5*9.7 or 143 sq meters
constant*sq. deck area = silas?
sq cubits deck area
996.8*95literspergur*/300=315.4  gurs
88/.3
92.4690 sq. meters
25 meters =35 cubits
deck area = 349 square cubits

Testcase 1., Sumerian coefficients on ships

trading ship 1 meters feet grain ship 2 meters feet
length 18.3 60.024 length 29.2 94.608
beam 3.96 12.9888 beam 9.7 31.428
body depth 1.82 5.9696 body depth 3.96 12.8304
draw 0.914 2.99792 draw 2 6.48
freeboard 0.914 2.99792 freeboard 2 6.48
deck perimeter 40 131.2
deck arclength 20 65.6
Estimates,other units < < < < <
tonnage formula 82.4447185831527 Eng.tons
cargo deadweight 53.8648113862264 Eng.tons
hull weight 10 1000* kg hullweight 82 1000*kg
deck surface area 92.5 sq meters deck surface area 243.3 sq meters
crew mass 8 1000*kg crew mass 6 1000*kg
equipment 8 1000*kg equipment 48 1000*kg
officers 5 men officers 3 men
rowers 50 men rowers 30 men
steersmen 5 men steersmen 4 men
sailing (alone) speed 6600 meters/hour sailing (alone) speed 6600 meters/hour
rowing speed 6000 meters/hour rowing speed 4000 meters/hour
sailing only travel 160 km/day sailing only travel 160 km/day


Testcase 3., Sumerian coefficients at the basket factory

Sumerian coefficients at the basket factory
coefficients english decimal comment
in base 60 name /fraction
6 coefficient reed bundle 6 constant of a reed-bundle, may be used as reciprocal (1/6)
7;12 bundles in pack of reeds 432 constant of a reed bundle. 432 units, bundles of reeds
04:58:00 reeds conv to baskets 298 possibly 298 baskets from 432 bundles of reeds
40 portion of basket (40/60) 40/60 portion of basket from one reed bundle
24 poss. haystack (24/60) possibly 24/60 onto floor/roof, possible haystack to dry reeds
20 poss. price of reeds 20 possibly 20 manas of reeds cost a silver shekel
0;3:45 coverage area for mat 0.0625 reed bundle into reed mat covering 0.0625 portion of surface sar
0;03:36 straw constant 0.06 straw bundle into straw mat .06 portion of surface sar
12 hours of workday 12 common to several accounts and math problems
1;39 basket surface equiv. 0.02777 reed bundle equivalent to a mat of 0.02777 surface sar
5;20 reed bundle basket conv. 320 320 baskets equivalent to 480 bundles of reeds
1 indiv. basket to reed conv. 1 one big pannum basket (60 silas) per reed bundle
10 daily pay for skilled worker 10 10 pieces per day, common to several accounts and math problems
3 3 baskets a day 3 expected output of one worker a day, 3 big pannum baskets
3 3 day, mat for 40 gur boat 3 maybe a sail or tarred deck mat,poss. equivalent to 9 sq. meters
4.5 4.5 day, mat for 60 gur boat 4.5 maybe a sail or tarred deck mat, poss. equivalent to 13.5 sq. meters
Note: Some of the equivalents at the bottom are not in coefficient tables, but are taken from accounts or Note: Possible large reed units (480 bundles) are a wagonload or
math problems, alternate info needed to solve some problems. water dory load. Possibly 20 manas of reeds was a manload from the swampy coast.

Testcase 4., Sumerian coefficients at the shipyard

Sumerian ship name Sumerian rated capacity displacement volume hull & equipment vol. proportional hiring fee proportional hiring fee length beam depth side arclength L/B ratio modern tonnage rating modern cargo rating
plus comparisons ship capacity, gur units gur units, (5/3)*capacity gur units, (2/5)*displacement liters of barley per day silver shekels per day meters estimated meters estimated meters estimated meters estimated estimated tonnage volume m**3 cargo vol. m**3
gis magur 120 120 200 80 240 20 40 13.33 4 49.50 3 568.70 341.22
gis magur 60 60 100 40 120 10 20 6.66 2 24.75 3 66.27 39.76
gis magur 50 50 83.33 33.33 100 8.33 16.66 5.55 1.66 20.62 3 37.61 22.57
gis magur 40 40 66.66 26.66 80 6.66 13.33 4.44 1.33 16.50 3 18.80 11.28
gis magur 30 30 50 20 60 5 10 3.33 1 12.37 3 7.68 4.60
gis magur 20 20 33.33 13.33 40 3.33 6.66 3 1 8.25 2.22 4.52 2.71
gis magur 10 10 16.66 6.66 20 1.66 3.33 3 1 4.12 1.11 2.2 1.32
gis magur 5 5 8.33 3.33 10 0.83 1.66 1.7 1 2.06 0.98 0.59 0.35
comparisons below < < < < < < < < < < <
Phoenician trading ship 5.8 9.66 3.86 11.6 0.96 18.3 3.98 1.82 22.64 4.59 32.13 19.28
Cyprus trading ship 6.5 10.83 4.33 13 1.08 15 5 2 18.56 3 36.52 21.91
Egyptian punt 8.8 14.66 5.86 17.6 1.46 20.3 4.9 2 25.12 4.14 48.93 29.36
Greek trireme 12.19 20.31 8.12 24.38 2.03 39.6 5.5 1.25 49.00 7.2 67.70 40.62
Roman grain ship 52.9 88.16 35.26 105.8 8.81 29.2 9.7 3.96 36.13 3.01 292.74 175.64
Viking Raider 3.89 6.48 2.59 7.78 0.64 17.4 2.6 2 21.54 6.69 21.63 12.98
American Schooner 87.9 146.5 58.6 175.8 14.65 44.5 10.66 3.88 55.07 4.17 488.29 292.978512690728
English Brig 55.6 92.66 37.06 111.2 9.26 38.3 7.93 3.89 47.40 4.82 308.89 185.33
American Clipper (giant) 1428 2380 952 2856 238 92.96 16.15 18.3 115.04 5.75 7933.85 4760.31
Liberty cargo (1944 & steel) 1146 1910 764 2292 191 133.05 19.203 8.69 164.66 6.92 6370.54 3822.32


Testcase 5., Sumerian coefficients at the bitumin refinery

coefficient transliterated english possible decimal /fraction
15 igi.gub.esiri.e coefficient refined pitch 15/60
16 igi.gub.esiri coefficient raw pitch 16/60
15 ssa esiri coefficient pitch 15/60
12 ssa esiri coefficient (refined?) pitch 12/60
10 45 06 ssa ina ki-ri-im coefficient (refined?) pitch 0.1794
15 ssa esiri ? coefficient (raw?) pitch 15/60
15 ssa esiri-e-aIt coefficient refined pitch 15/60
2.5 barig (of) esir-e-a price wet pitch 2.5 barig for 1 shekel , URIII
10 gu (of) esir-had price dry pitch 10 gu for 1 shekel , URIII
12 gu (of) esir-had price dry pitch 12 gu for 1 shekel, URIII
4 ban (of) esir-had price dry pitch 4 ban for 1 shekel, Babylon 1900 BC

Note: esir-e-a (bitumen watery) measured by barrels ( or jars) of 60 liters eq. esir-had (bitumen dry) measured by weights of 30 kilogram (manload). Any coefficient calculation would have to account for units of wet (ŠE system Š* for wet capacity) or dry (EN system E)

In crude oil, the tar fraction from 10-14 %, 5.25 kg to 7.3 kg out of 52.5 kilograms of converted barig 60 liter unit. Babylon sold 40 liters of dry pitch (esir had) for 1 silver piece and 60 liters of construction and waterproofing pitch for 1 silver piece. If price is measure of petroleum fractions for heavy (esir a) fraction and tar fraction, the tar fraction was 40 liters (for a shekel)/ 60 liters (for a shekel) , 2/3, or 40/60 of the heavy esir a fraction. The texts mention both boiling/cooking and (implied) sun dry. Suppose that the Babylon products were derived from successive boiling or sun-dry processes, then a crude production line or process could be outlined: 100 liters crude oil > 85 liter lamp oil > 60 liters construction & waterproofing pitch > 40 liters dry pitch. Starting with 100 per cent, boiling would remove spare water impurities, ( straining) plant matter,gasoline, and naphtha, leaving about 85 percent for lamp fuel (eg. kerosene) and medicine. Further boiilg would remove kerosene and some mineral oil leaving 30 percent of the original crude oil for a heavy oil/pitch fraction (esir a) for waterproofing woven products and construction of floors, walls, and waterproofing bricks. The next stage would boiling or drying the heavy oil/pitch into the 20 percent residue called esir had. The conjecture here is that esir a was the feedstock for esir had. Esir had was used in crafts as a cement or mixed with stone powder as a sort of moldable plastic. Possibly, esir had was used as fuel in brick kilns, smelters, and other industrial processes.
   *mathematical coefficients of bitumen, Paul BRY (01-2002)7

possible fractions left at boiling or sun dry processes.
100 liters crude oil > 85 liter lamp oil > 60 liters construction & waterproofing pitch > 40 liters dry
modern fractions, no cracking
product fraction % starting 100% Babylon 100-% Cuneiforn name Bablylon use or comment
gasoline 1.7 98.3 no reported use
naptha 14. 84.3 85 naptum (fire oil)
kerosene 34 50 60 naptum (fire oil)lamp oil, medicine
bunker oil 18 32.3 30 esir a (wet pitch waterproofing,construction
tar,pitch,wax 15 17.23 20 esir had dry pitch
losses 12 5 5
total 100


Table of Sumerian Ship Coefficients etc.

coefficient in base 60 transliterated english possible decimal /fraction comment
0;13:15 ma-gur coefficient ship (for) area 13/60+15/3600 for geometric area of barge figure, derived from 90 degree c. sector
0;13:20 ma-gur coefficient ship (for) area 13/60+20/3600 for geometric area of barge figure, derived from 90 degree c. sector
0;13:20 se (barley grain) coefficient (for) seed area (barge equal?) 13/60+20/3600 for geometric area of seed figure, derived from 90 degree c. sector, most advanced math from Susa & iron age Sumeria
45 ma-gur coefficient ship (for) area ratio? 13/60+20/3600 for geometric (barge area/sector area) of barge figure, derived from 90 degree c. sector
16 in alpim coefficient ox-eye (for) area 16/60 for geometric area of barge figure , derived from 120 degree c. sector
0;16:52:30 in alpim coefficient ox-eye (for) area 16/60+52/3600+30/21600 for geometric area of ox-eye figure , derived from 120 degree c. sector, most advanced math from Susa & iron age Sumeria
5 sa gis magur (wood boat) conversion coefficient (for) ship capacity 5 coefficient*nindan*nindan=volume gur, early? age math
6 sa gis-ma-la conversion coefficient (for) ship capacity in gur/sar 6? coefficient*nindan*nindan=volume gar, middle? age math
7:12 elepuum (long ship) conversion coefficient (for) ship capacity in gur/sar 7+12/60? coefficient*nindan*nindan=volume gur, most advanced math from Susa & iron age Sumeria
0;4:48 e-kisib-se coefficient (for) thickness of log (cylinder capacity) 4/60+48/3600 possibly coefficient*cubit*cubit=volume silas
45 a-bal coefficient for bucket 45/60 possibly area or volume of irrigation bucket
30? nus (egg)? conceptual coefficient for egg volume,not seen on tablets 30/60? thinking point for sphere volume,not seen on tablets, (pi/6)*D**3 approx. (30/60)*D**3, found one Egyptian statement that cylinder volume oc egg?


the other hand quotas which must have been set in a more esoteric fashion, such as the 15 workdays expended per gur capacity in barge construction (a barge of 30 gur capacity shoud be built with 450 workdays) attested in TCL 5, 5673 (MVN 2, 3 seems to record a quota of ca. 10 days per gur capacity). 4·3) KWU p. 132 c. F. Thureau

Sumerian coefficients at the trades

daily work of one man
in base 60 translitered name english decimal /fraction reciprocal comment
0:12 sa has-as-bi coefficient it's 12/60 5 possibly making 5 ration bowls a day , pottery
4 sa dug bi coefficient rate 60/15 15/60 making 4 ration bowls a day , pottery
3:45 sa pi-ti-iq-ti coefficient wall high 3/60+45/3600 16 raising mud wall, 3/60+45/3600 surface a day
20/60 sa sag coefficient making bricks 20/60 60/20 making 240 bricks a day or 20/60 sar
1:30? igi.gub gis coefficient wood funiture 1+30/60 90/60 1.5 days on task, pegging planks, making door, bed or chair a day
40/60 sa gis-ig coefficient wood door 40/60 60/40 2/3 door a day, planing wood and pegging planks
3 sa gis pannum coefficient wood crates 3 20/60 3 crates a day, pegging planks, pannum measure crates
7:26 sa gis coefficient making wood plank surface ~7/60 ~ 60/7planks & crates ,daily 3crates*6sides*.497*.497= 4.44 sq.m., 4.44/36 = decimal 0.123 sar or 7/60+ 23/3600 sar daily


(under proofreading) The research made some trial calculations with density of bronze from 1 )modern density values and 2) ancient density values from the Old Babylonian coefficients. For the modern density values in kilograms per cubic meters, the values were tin (7176),bronze (8189), and copper (8890). Using r1:1 as the copper:tin ratio, the generic formula was tin_density*(1/(r1+1))+copper_density*(r1/(r1+1)=bronze_density. Multipling (ri+1) term and substituting, 7176+r1*8890=8169+r1*8169, and combining r1*99.3=721. The alloy ratio r1 for the modern bronze density value was 721/99.3, 7.26. (under proofreading)

In the eTCL calculator, kilograms are used with the price ratios of copper (1/90) and tin (1/20) for UrIII. From the trial calculations, these price ratios were transferred correctly to kilograms of silver. The price table contains redundant entries from different texts. However, the trade values or price ratios were undoubtedly different in different eras, countries, and texts.

Pseudocode and Equations

  Sumerian price in silver = [/ liters 300.]
  Sumerian price in liters grain = [* silver 300.] 
  # 1 silver piece = 1 gur = 300 liters of grain
  liters = [* volume_in_cubic_cm .001]
  original copper mass + original tin mass - product mass = smelter loss 
  original metal mass - product mass = smelter loss
  original metal mass * average refining loss in percent= refining loss 
  original metal mass - refining loss = product mass
  30 to 40 kg of charcoal for 1 kg of copper, rule of thumb (for smelting copper in raw ore)
  original metal mass * price ratio in silver 1/N =  price in silver
  6 bundles or 60 kgs of reeds for 1/2 mana of copper, rule of thumb
  120 manas or 60 kgs of reeds for 1/2 mana of copper, rule of thumb
  bundle of reeds was 20 manas  or 10 kg 
  price? = raw materials + labor  +  profit
  price? = raw materials + heat process
  price? = raw materials + labor 
  average price per unit  = revenue  / units sold

Table 1 , UrIII Prices

UrIII Metal pricesper silver shekel etc country, era
quantity value comment, if any
copper 3 minas= 180 shekels Babylon, Esnunna Code prices, 1900 BCE, for comparison
copper 1.5 minas= 90 shekels NeoSumerian, UrIII, circa 2300 BCE
copper 80 shekels NeoSumerian, UrIII, circa 2300 BCE
tin 12 shekels NeoSumerian, UrIII, circa 2300 BCE
tin 20 shekels NeoSumerian, UrIII, circa 2300 BCE
red gold 15 shekels NeoSumerian, UrIII, circa 2300 BCE
gold 7 shekels NeoSumerian, UrIII, circa 2300 BCE
gold 20 shekels NeoSumerian, UrIII, circa 2300 BCE


Table 2 , OB Prices

O.B. Metal pricesper silver shekel etc country, era
quantity value comment, if any
iron 8 shekels Southern Mesopotamia, Old Babylonian period
iron 12 shekels Mari, Old Babylonian period
iron 40 shekels Assur, Old Babylonian period
gold 3-6 shekels Southern Mesopotamia, Old Babylonian period
gold 4-6 shekels Mari, Old Babylonian period
gold 4-8 shekels Assur, Old Babylonian period


Table 3 , Price and Exchange ratios

Metal price ratios for comparison country, era
quantity value comment, if any
silver/gold price 10:1 NBC6641,NeoSumerian, UrIII, circa 2200BCE
silver/gold price 10.2:1 Yale YBC13418A,NeoSumerian, UrIII, circa 2200BCE
copper/silver price 9:1 Ancient Egypt, New Kingdom
tin/copper price 6.6:1 Athens, Greece, circa 500BCE
silver/gold exchange ratio 12:1 Ancient Rome, Augustus reign, 30BCE


Table 4 , Old babylonian coefficients , comparison metal density

metal etc old babylonian coefficients talents/sar manas/sar kg/sar OB. coefficient modern,kg/m**3 comment
metal etc 3600 60 1 talents/sar manas/sar kg/sar kg/cubic meters kg/cubic meters comments
gold (electrum?) 1_48_0 6481 388860 193535.622 10751.979 19302 gold and silver alloy
gold 2_15_0 8100 486000 241882.2 13437.9 19302
lead 1_52_30 6720 403200 200672.64 11148.48 10989
silver 1_36_0 5790 347400 172900.98 9605.61 10492
iron 1_12_0 4320 259200 129003.84 7166.88 7208
copper 1_12_0 4320 259200 129003.84 7166.88 8890
tin 1_20_21 4821 289200 143934.8 7996.4 7176
bronze 1_20_0 4800 288000 143964.702 7998.039 8169
brick 0_12_0 741 44460 22127.742 1229.319 1600 possibly light adobe
alulutum-mineral: 0_20_24 1200 72000 35834.4 1990.8 2000

Testcases Section

In planning any software, it
        # pretty print from autoindent and ased editor
        # Ship length from arclength and ship beam
        # written on Windows XP on eTCL
        # working under TCL version 8.5.6 and eTCL 1.0.1
        # gold on TCL WIKI , 17jul2013 
       package require Tk
       console show
        proc shiplengthx { a b } {
            set length  [expr { sqrt($a*$a - (16./3.) *$b*$b*.5*.5 )}]
            return $length
        }
        lappend shiplist [ shiplengthx 3 .68 ]
        lappend shiplist [ shiplengthx 6 1.35 ]
        lappend shiplist [ shiplengthx 9 2.03 ]
        lappend shiplist [ shiplengthx 12 2.7 ]
        lappend shiplist [ shiplengthx 15 3.38 ]
        lappend shiplist [ shiplengthx 18 4.05 ]
        lappend shiplist [ shiplengthx 21 4.73 ]
        lappend shiplist [ shiplengthx 30 6.75 ]
        lappend shiplist [ shiplengthx 18 5.12 ]
        puts " $shiplist"
   # pseudocode can be developed from rules of thumb.
    pseudocode: enter triangle height ,triangle width , penny or coin diameter
    pseudocode: rules of thumb can be 3 to 15 percent off, partly since g..in g..out.
    pseudocode: packing pennies in equilateral triangle,
    pseudocode: base of triangle 10 pennies wide.
    pseudocode: height of triangle 20 pennies tall
    pseudocode: pennies will be paced in layers equal to width of diameters, non optimal spacing
    layers diameter of coin, initially 10 coins wide
    find width of every stack  for each  stack layers
    foreach layer {1 2 3 ... N coins high} {calc. coins} 
    pack number of circles in each layer,  short of sides,
    add circles  to total, when finished print result
    need  console show
    set addlayer 0
    set level 0
    set numberpennies 0
    incr $addlayer
    set  level [ expr { $level +$addlayer } ]
    set width  [ expr {  2.* 10.* asin($level/$width) } ]
    set numberpennies  [ expr { $numberpennies+ int($width) } ]
   pseudocode: need test cases > small,medium, giant
   within range of expected operation.
   pseudocode: are there any cases too small or large to  be
  solved? 
  pseudocode: Could this be problem similar to grains on      
   chessboard?

    
        # counting pennies in equilateral triangle
        #   eTCL console example program
        # written on Windows XP on eTCL
        # working under TCL version 8.5.6 and eTCL 1.0.1
        # gold on TCL WIKI , 18jul2013 
        package require Tk
    console show
    set addlayer 0
    set level 1
    set numberpennies 0
    set width 10
    # height is 20 pennies
    foreach layer {1 2 3 4 5 6 7 8 9 10 11 12 14 16 17 18 19  20} {
        incr $addlayer 1
        set  level [ expr { $level +$addlayer } ]
        set sintarget [ expr { 1.*$level/$width } ]
        set width  [ expr {  2.* 10.* asin($sintarget) } ]
        set numberpennies  [ expr { $numberpennies+ int ($width) } ]
    }
        puts " $numberpennies   "

        # pretty print from autoindent and ased editor
        # Ship beam  from 1/4 ship length
        # accepts multiplication factor N*list
        # example as list of Sumerian ship lengths
        # and dividing by 4 for poss. ship beam
        # (max width)
        # written on Windows XP on eTCL
        # working under TCL version 8.5.6 and eTCL 1.0.1
        # gold on TCL WIKI , 24jul2013 
        package require Tk
        namespace path {::tcl::mathop ::tcl::mathfunc}
    console show
       proc multiplylist { factorx args } {
        set factor_x " is constant or expression "
        set args_x   " targeted list of numbers " 
        set icount -1
        foreach item  $args  {
            incr icount
            lappend result_list [* $factorx $item 1. ]
        }
        return $result_list
    }
        proc shiplengthx { a b } {
            set ship_arc_length "a"
            set ship_beam "b"
            set ship_length 1
            set ship_length  [sqrt([* $a $a ]-[* [/ 16. 3.][* $b $b .5 .5 ]])]
            return $ship_length
        }
    puts " ship arc conv to arc meters as 6*N >> [ multiplylist 6 .5 1. 1.5  2. 2.5  3 3.5  5.0  ] "
    puts " ship beam as .25*L meters >> [ multiplylist  .25 2.89 5.79 8.68     11.58 14.48 17.38 20.27 28.96 ]"
   
    set ships {2.89 5.79 8.68     11.58 14.48 17.38 20.27 28.96}
    puts " test of math ops, mean >> set mean [/ [+ {*}$ships] [double [llength $ships]]]"

Schedule for the Gades brick piles, many assumptions

In some Sumerian contexts, the Giparu or sacred precinct was the residence of the en-priestess of the Moon god (Nanna or Ninnar), effectively a state cult for enthroning the king. The Giparu was the site of the Sacred Marriage Rite, probably conducted every year at various major cities. "pa4" is a Sumerian root word meaning priest; "gi6" is a Sumerian root word meaning earth or dark place. Sometimes, the en-priestess was the daughter or other kin of the king. In Sumerian, "en" means the king or shepherd. Also, successive en-priestesses or other offerings were buried under the floor of the Giparu. A later era calcite medallion of Enheduanna shows the Akkadian en-priestess conducting a threshold sacrifice. The medallion shows a triangular wall of 15 degrees face which would be called a buttress wall in modern terms.

Locally in the Umma tablets , the local temple was called the Shara or Sara. The Sumerian word “Sar,Sa, or Sagina” is a root word meaning king, general, or royal officer in some contexts (ref. sag means head). The temple at Umma is sometimes referred as Sara on the quay, house of Sara, Sara of Umma. The temple was supported by the province of Umma and further received revenues and products locally. While not all the Umma tablets can be dated to the reign of King Amar-suen ( 2046-2038 BCE ), many tablets can be correlated by the local calendar of Umma, seals/names of the project personnel, and by personal names such as Ur-Sara (steward of Sara), Lu-Sara (man servant of Sara), Sara-mutum (woman servant of Sara. There was even a common beer called Sarazi (Sara Beer) and a common ration cereal called Sara-emmer (Sara Wheat).

There was an Inanna temple near Zabalum. Men were normally forbidden in the temple (after consecration). Aside from the priestess there were about 60 women singers who served in the temple rites, but probably were housed on the dower estate of Girsana.

The brick piles at Gaes can be placed in a tentative association with the events in the reign of King Amar-Suen. The associations are not really a formal history, but are culled from clay tablets on receipts, chits, and legal documents from the Ur III period. King Amar-suen came to the throne in 2046 BCE and the reign numbers refer to this date. The following individuals received a staff of high office:Akhuni, Ue-Enlilla son of the Elamite(?), Lu-Shara son of Urzu, Lu-ibgal son of Lugal-massu, the military governor, and Ur-Lisi, the governor of Umma province (no dates given). One tablet cites Lu-Shara as a scribe and another tablet as a hazannu official (mayor ). Lu-Shara was probably the mayor or administrative scribe under Ur-Lisi, in the reign of Amar-Suen. In Amar-Suen 1, Ur-Shara the scribe paid a credit for 19 copper sickles and 8 copper pickaxes. In Amar-Suen 1, the governor of Umma paid a credit for 170 male workers or about 5 workcrews for one day. Three promissory notes and two receipts on the Gades bricks were dated to the month of Akiti of Amar-Suen 4, mostly similar descriptions of the brick piles. Lu-sin accepts 33 sar of brick for the (moon?) temple and 10 sar of bricks for the military depot (marsa) storage house (no dates or specific location given). While not all the bricks can be established as fired, the fired bricks were probably intended as foundation bricks, underground dedication shrine boxes ,and high use floors/thresholds (ref. the Nimintabba temple at Ur and the Inanna temple at Nippur. Some of the fired bricks were probably used in rebuilding the Karzida quay in front of the moon temple. By custom, the buttressed walls of the en-priestess residence were exceptionally thick and the foundation under the walls was extra strong. In Amar Suen 7, The en-priestess En-Nanna-Amar-Sin-kiagra was installed at Gades/Karzida (for the first time). In Amar Suen 9, the en-priestess En-Nanna-Amar-Sin-kiagra was installed at Gades/Karzida (third time). The project was believed to be completed in the ninth and last year of the reign of Amar-Suen. The available data suggests the building or restoration on the moon temple was completed in 4 to 6 years.

Schedule for Gaes bricks, tentative and many assumptions

event year of reign year BCE comment comment
King Amar-suen begins reign in third dynasty of Ur Amar suen 1 2046 clay tablet, king list
King Amar-suen directs restoring temples of Sumeria at Ur, Eridu, and Gades Amar suen 1 2046 building inscriptions & assumptions
Ur-Shara buys 19 copper sickles and 8 pickaxes Amar-Suen 1 . 2045 food and economic preparations
Year King Amar-Suen raided Urbilum Amar-Suen 2 . 2045
Year King Amar-Sin made a silver throne for Enlil Amar-Sin 3 2043
bricks ordered?? Amar suen 3?? 2043 assumption
bricks on site at Umma Amar suen 4 2042 5 clay tablets
Umma province ships bricks to Gaes, remaining mudbricks cured , building and repairing enpriestess residence (temple) begins at Gaes >> Amar suen 5? 2041 many assumptions
Year Shashrum was raided for the second time Amar suen 6? 2040 clay tablet
enprestess En-Nanna-Amar-Sin-kiagra installed at Gaes/Karzida (first time) Amar suen 7 2040 clay tablet
Year Khukhnuri was raided Amar-Sin 72040.clay tablet
enprestess En-Nanna-Amar-Sin-kiagra installed at Gades/Karzida Amar suen 8? 2039 clay tablet
Year the priest of Eridu was installed Amar-Sin 8.2039 clay tablet
enprestess En-Nanna-Amar-Sin-kiagra installed at Gaes/Karzida (third time) Amar suen 9? 2038 clay tablet
possible project completed at Gades/Karzida Amar suen 9? 2038 many assumptions
King Amar-suen dies, trampled by hooves of oxen in battle??? Amar suen 9 2038 clay tablet, king list
quarters of Umma province, URIII kingdom number of plow teams arable land kmsq
Da-Umma 60 233.28
Apisala 20 77.77
Guedina 10 38.8
Musbiana 10 38.8
Zalabam-Gasana 5?? 19.4
each team assigned 6 bur, 6*64800 sqmeters =3888000
3888000 sq meters is 3.88 square kilometer

canal regulators and (hence substantial burnt brick yards) were located at Umma,Girsu,Lagash,Shurruppak,Larsa,and Isin.

1.3E6 bricks were used at Isin. 68.6E3 bricks were estimated at Girsu 4.46E5 bricks used at Lagash Rebuild (second reg) 4.325E5 bricks used at Lagash (first reg.)

Wages at the Girsu Resthouse and Prison.
English title Sumerian title grain beer if any meat portions if any other gifts, comments
messenger sagkakdu 5 5 1/2 sheep
guard for messenger lu-gis.tukul 2 liters 1/2 sheep, 1 leg
cupbearer zabardab 5 +mutton
overseer ugalug 5
captain or overseer of prison tow boat 5
ship builder craftsman ma-gin Ma-[gan.sup.ki 5?
tow gang sa-bar-e [dab.sub.5]-ba 2
bird keeper sa-musen? 2 2
ox driver sa-gu.sub.4 2 2
woodshed sheephousee udu ga-nun gis 2 reed fodder, smoked meat etc
apprentice scribe dub-sar-tur-tur 2
prison guard, trooper 2
dog keeper 2
carrier, porter UN-il 2
elderly worker of good status lu su-[gi.sub.4] 2
invalid of good status lu HU.KU.BU 2
Invalids under intermediary foremen lu HU.KU.BU 1 hot soup
women prisoners of war lu HU.KU.BU 1 or 4/3
prisoners of state ganab 1 carried reeds etc
male war captive nam-ra-aka 1/2
children of the mule keeper dumu sipa ansekunga[-me]) are 1
children of rope towers TUR.TUR kir-[dab.sub.5] 1/2
children of grass carriers 1/2
children of carriers UN-il-TUR.TUR 1/2
ocasionally 30 or 50 prisoners assigned to carry reeds
canal regulators and (hence substantial burnt brick yards) were
located at Umma,Girsu,Lagash,Shurruppak,Larsa,and Isin.
wife of governor had allotment of 2 gur of grain and 30 sheep carcasses
high status individuals and foremen were intermediaries
intermediaries doled grain mush, beer, hot soup, and clothing to retainers


History of Cuneiform Math years artifact comment active cultures
YEARS BCE Nippur/Jewish count
BCE fm 3760 BCE artifact comment
3500 240 Proto-literate Uruk Sumeria
3500 240 calendar Nippur lunisolar Nippur,Sumeria
3200 540 writing notable Uruk IV writing notable Sumeria
2550 1190 Scribal profession temple administers and scribes separate caste from priests Sumeria
2350 1390 Sargonic math King Sargon of Akkad, effectively creates needs for imperial math Sumeria
2100 1640 sexagesimal place value notation UrIII or Neosumeria Sumeria
2075 1665 place value place value notation introduced, probablt king shulgi's reforms Sumeria
1792 1948 Conquests of King Hammurabi Hammurabi removes many players from board Old Babylon period
1775 1965 Eshnunna“algebraic” problems Eshnunna math texts Old Babylon period
1758 1982 Mari math, place-value techniques possible math texts spread to Mari, 1800 to 1758 Old Babylon period
1749 1991 Larsa math tables of squares,inverse squares, and cubes Old Babylon period
1600 2140 Venus observations Nippur lunisolar Old Babylon period
1595 2145 collapse of Old Babylon and state sponsers Hittite raid on Babylon Old Babylon period
1400 2340 star list Ea, Anu, and Enlil Nippur,Sumeria
1200 2540 star list stars of Elam, Akkad, Amurru Sumeria
1150 2590 astrolab stars Ea,Enhil,Anu Sumeria
1000 2740 star table stars Ea,Enhil,Anu Sumeria
1000 2740 star table more stars for Ea,Enhil,Anu Sumeria
700 3040 star table heptagon tablet, related to star lists? Neo-Assyrian Empire
600 3140 lunar eclipse compilations partly based on star lists Persian Empire
575 3165 Saros lunar calc. in use partly based on star lists Persian Empire
500 3240 year goal texts, Bablyon partly based on star lists Persian Empire
350 3390 Susa geometry & incipient zero Susa geometry & rare use of checkmarks for placeholder and incipient zero Susa, Old Elamite kingdom, Persian Empire
350 3390 use of incipient zero in Astronomy rare use of checkmarks for placeholder and incipient zero Bablyon, Seleucid Empire
315 3425 end of lunar eclipse tables partly based on star lists Bablyon, Seleucid Empire


In one coefficient list, there was a coefficient for wool (igigubbum-hi-a) as 48 in a base 60 fraction (48/60). The term igigubbum is Akkadian, apparently borrowed from Su, igi-gub-ba ( I see fraction (used as reciprocal)). The term hi-a appears in URIII texts associated with wool and textiles, and means processed wool or processed fleece. In the Nippur lexical lists, the term siki al-hi-a was translated as processed wool (work). A math problem using the wool coefficient is not available, but will try to convert 48 in base 60 into modern decimal units and proportions. In modern terms, the equation is coverage area * reciprocal coefficient equals material. Starting with Sumerian units, the coverage area in sar units times reciprocal coefficient (60/48) equals weight of wool in gu units, simply sar*(60/48)=gur. Rearranging terms, the proportion is gu units/ sar units = 60/48 or sar units / gu units = 48/60. The proportions hold true if 60 /48 is reduced to 5/4, meaning 5 gus of wool equals 4 sar of woven cloth. 5 gu/4 sar equals (5*60*0.4977) kg/4*32 sqm, 1.166 kg/sqm, 1166 grams/sqm for wool cloth. This figure of 1166 grams/sqm is probably one weight of wool cloth and probably the Sumerians used other cloth weights also.

For the clothing, its easier to use square cubits than sars. A sar equals 144 square cubits, and a gu equals 60 manas. So the 5/4 ration above would equal (5*60)/(4*144), 0.521, rounding 0.5 manas per square cubit. Or the reciprocal was equivalent to 2 square cubits per mana. The 2 mana ration to low status men would be equivalent to 2*2 or 4 sq cubits of woolen cloth. The 3 mana ration to craftswomen would be equivalent to 3*2 or 6 sq. cubits. The 4 mana payment to project overseers would be 4*2 or 8 sq. cubits. The child's garment above would be 3*2 or 6 sq. cubits. The high status female full skirt would be 3.5*2 or 7 sq. cubits. The tug-guz-za long shirt for the high statue male weighed 5.474 manas and was 5.5*2 or 11 sq. cubits. In general, the wool ration and the weight of clothing was a measure of status.

Is Thales theorem easier to use ?

Dear uniquename, I noticed you referred to Thales Theorem in one of your posts. I have a question on the use of Thales Theorem by Old Babylonian mathematicians (circa 1900 BCE). By remainders and artifacts in base 60 problems and math coefficients, there appears to be one tradition of Babylonian mathematicians that derived formulas from Thales Theorem and one tradition of Babylonian mathematicians that derived formulas using Pythagoras or sqrt(sum squares). Apparently, the Greek Thales was of the former persuasion in a different era. Especially the dual use of Thales Theorem and sqrt(sum squares) is seen in the Old Babylonian coefficient lists (base 60), ref. Eleanor Robson paper on coefficient lists at Oxford. Supposing no computers or slide rules, is the Thales Theorem easier to use than sqrt(sum squares)? Does the Thales Theorem produce numbers that are easier to factor in simple primes (2,3,5),use in pi multiplication, use in base 10, or surveying land (with equilateral triangles)? Old Babylonians are known to have avoided division and usually numbers 7 and 9 in math problems, as producing numbers difficult to factor in the base 60 system. My email service is erratic lately, please post your reply at the end of my tcl wiki homepage, thanks gold

Gaming solutions or false positions with eTCL calculator

It is possible to find solutions to equations using the method of false positions (regula falsi) or gaming with the eTCL calculator. Suppose a coating of some known thickness is applied on known surface area and one wished to estimate the coating coefficient. From an initial solution either from the testcases already loaded into the calculator or from order of magnitude calculations, the coating coefficient can be estimated from a series of guesses or false positions in incremented steps. The accuracy of the coefficient solution depends on step size and is usually given as half step size (0.5*step). For example, the solution if found in the series <1, 1000, 2000, 3000, 4000,5000> would have a accuracy of plus or minus 1000/2 or 500. Loosely speaking, this is operating the eTCL calculator in reverse. Finding the coefficient that gives a solution of specified input (2 sides of a surface area) and specified output (volume).

This is the gist of an Old Babylonian (OB.) math problem for water irrigation, converted to metric units from clay tablet YBC4186. A cubic water cistern of L/W/H 60/60/60 meters was used to irrigate a square field to a depth of 0.015 meters. The volume of the cistern would be L*W*H, 60*60*60, 2.16E5 cubic meters. What are the dimensions of the field, assuming square field? In terms of a modern algebraic equation, the answer was field area equals L*W*H/D, 60*60*60/0.015, 14.4E6 square meters, or 14.4 square km. Each side of the field would be sqrt(14.4) or 3.8 km. To initialize the eTCL calculator, press testcase 1 and push solve, returning the first test case solution. In the length and width fields, enter 3.8E3 meters and solve should return the correct surface area (14.4E6).

Continuing with the OB. water irrigation problem, it is possible to game on a eTCL solution for the coefficient (not in the OB. solution or outside the OB. text). Loading and solving for possible test solutions (regula falsi) as (coefficient = 1000, 2000, 3000, 3500, 4000), the coefficient in the test problem is close to 3400.

RLE (2014-05-20):

You have the following statement in almost all of your pages:
Report allows copy and paste from console, but takes away from computer "efficiency".

What do you mean by "takes away from computer 'efficiency'" in the context of allowing copy/paste?

How do you see allowing copy/paste as "taking away computer efficiency"?

gold On one of my early posts to tcl-wiki, I received a gripe about using puts in my calculating programs, which might take away from computing speed in an algorithm subroutine. I guess we were assuming number crunching was the main job of the computer. I still use the puts, but the caution seemed valid.

Thanks for the feedback.

RLE (2014-05-23): Ah, I see. Ok, the advise was valid, but not for the reasons your words on your pages state. Copy and paste from console has nothing to do with "taking away from computer efficiency".

Given what you have said above, the "gripe" would likely have been directed at performing a puts inside of a numerical computation loop, i.e., doing this:
  for {set i 0} {$i < 10000} {incr i} {
    for {set j 0} {$j < 10000} {incr j} {
      lset matrix $i $j [ expr { [lindex $matrix $i $j] * [lindex $matris $j $i] } ]
      puts "$i $j [ lindex $matrix $i $j]"
    }
  }

This (made up) numerical computation loop above iterates 100,000,000 times. The result is it runs puts 100,000,000 times, which will slow down the loop because puts has to do output (lots of other code to execute to ultimately achieve the "output" operation). Removing that puts (or commenting it out) would speed up that loop by quite a large amount.

Also, note that while debugging, sometimes running a puts inside the inner loop to see intermediate results can help you locate a bug or a math error.

But there is a difference when it comes to output of results to a human (or another machine). At that point, you have little choice but to perform at least one puts (assuming you appended your result together beforehand). For an "output of results" routine, the point is to perform output, so running puts is not reducing "efficiency", rather it is the whole point of the output routine.

With that said, if you were doing something like outputting one character at a time of the result, with a puts per character, then yes, that would have been inefficient.

So the "gripe" was most likely not a blanket "this applies to everything" statement, it was much more likely a "given what you have here, you are being inefficient" "gripe". The difference is important. It seems you may have over-generalized the "gripe". gold Text on console puts and efficiency mostly pulled from my wiki pages, 22may2014

Here is some eTCL starter code for cleaning TCL lists of empty, blank, or small length elements. This eTCL code is a compilation of various posts or ideas on this wiki. Sometimes, bare statements and variables in context were swapped and wrapped inside a consistent subroutine for testing. For testing the procs, lists of words or numbers can be generated , screen grabbed, or dumped into a TCL list with many empty, blank, or small elements. The orignal target list is multiple decks of 52 cards with added jokers as {}(empty element) { }(one blank space) {.} {} {;}.
 original {2 3 4 5 6 7 8 9 ...{} { } {.} {} {;} {} { } {.}...}
 routine #2 {2 3 4 5 6 7 8 9 ...   { } {.}  {;}  { } {.} ...} , empty elements removed

 routine #1 13.0177 microseconds per iteration
 routine #2 172.884 microseconds per iteration
 routine #3 8.0467 microseconds per iteration
 routine #4 6.9682 microseconds per iteration
 routine #5 1.8228 microseconds per iteration
 routine #6 4.7997 microseconds per iteration
        # written on Windows XP on eTCL
        # working under TCL version 8.5.6 and eTCL 1.0.1
        # gold on TCL WIKI, 15oct2014
        # Console program for list of Unicode cards, values, multiple N1 decks
        # N1*decks one liner from FW
        # cleanup from RS, working for small lists <25 e., problem with medium >500 e.
        # idea using regsub statements for blanks from RL
        # routine5 using statement from H
        package require Tk
        namespace path {::tcl::mathop ::tcl::mathfunc}
        console show
        global counter
        set cards { 2 3 4 5 6 7 8 9 10 J Q K A }
        set list_values { 2 3 4 5 6 7 8 9 10 10 10 10 11 }
        set jokers { {} { } {.} {} {;} {} { } {.} {} {;} {@} { } {.} {} {;} }
        set list_cards [ concat $cards $cards $cards $cards $jokers]
        proc lrepeat_FW {count args} {string repeat "$args " $count}
        set list_cards [ lrepeat_FW  10 $list_cards ]
        proc empty_elements_in_list1 {lister} {
            set new_lister {}
            foreach item $lister {
                if { $item != "" } {lappend new_lister $item} }
            return $new_lister}
        proc empty_elements_in_list2 {lister} {
            regsub -all "{}" $lister "" new_lister5
            return $new_lister5 }
        proc empty_elements_in_list3  {lister} {
            set take_out2 {}
            foreach item $lister {
            if { [string length $item ] > 0 } {lappend take_out2 $item}}
            return $take_out2 }
        proc empty_elements_in_list4  {lister} {
            set take_out5 {}
            foreach item $lister {
            if { {expr {[string length $item]}} > 0 } {lappend take_out5 $item}}
            return $take_out5 }
        proc empty_elements_in_list5  {lister} {
            set take_out6 {}
            while {[lsearch $lister {}] >= 0} { 
            set lister [lreplace $lister [lsearch $lister {}] [lsearch $lister {}]]            
            } 
            set take_out6 $lister
            return $take_out6 }
         proc cleaner {target args} {
            set res $target
            foreach unwant [split $args ] {
            set res [lsearch -all -inline -not -exact $res $unwant ]}
            # suchenworth idea
            return $res
            }
        puts " original $list_cards "
        puts " routine #1 [ empty_elements_in_list1 $list_cards ] "
        puts " routine #2 [ empty_elements_in_list2 $list_cards ] "
        puts " routine #3 [ empty_elements_in_list3 $list_cards ] "
        puts " routine #4 [ empty_elements_in_list4 $list_cards ] "
        puts " routine #5 [ empty_elements_in_list5 $list_cards ] "
        puts " routine #6 [ cleaner $list_cards A ] "
        puts " routine #1 [ time { empty_elements_in_list1 $list_cards} 10000 ] "
        puts " routine #2 [ time { empty_elements_in_list2 $list_cards } 10000 ] "
        puts " routine #3 [ time {empty_elements_in_list3 $list_cards } 10000 ] "
        puts " routine #4 [ time {empty_elements_in_list4 $list_cards } 10000] "
        puts " routine #5 [ time {empty_elements_in_list5 $list_cards } 10000] "
        puts " routine #6 [ time {cleaner $list_cards A } 10000] "

Bypublic nameon October 13, 2013 Format: Paperback “Life Giving Sword” or Yagyu Family Memorial by Yagyu Munenori has some interest in study of katana, kendo, taichi sword, or taji jian. Alternate English translations by William Scott Wilson in “Life Giving Sword” and Thomas Cleary in “Book of Five Rings” desparately need a glossary for common definition of terms. I have supplied a starter glossary for “Life Giving Sword”. As a common ground between east and west, a Romanji equilvalent text on shujishuriken (paraphrased) terms would be useful. I hope others can make contribution to meaning of shujishuriken and other terms in Life Giving Sword. If we can not build the whole bridge, we can add a few blocks.

Glossary of Yagyu-Ryu terms and words in Yagyu Family Memorial text (c. 1632 CE) . Terms below are from 17th century text, not necessarily same as Modern Japanese usage. Takuan Soho, Yagyu Munenori, and Miyamoto Musashi used homonyms, puns, or specialized terms, which are not found in conventional Romanji dictionaries. Romanji dictionaries contain homonyms, which are words that sound the same but have different meanings. Special combined terms in martial arts (Buddhist traditions) are noted by capitals, hyphens, or quotes. bo: wooden staff bocuto: wooden sword bokken: wooden sword, usually heavy wood for exercise. chi: vital energy, or broadly energy from earth and sky. Sometimes in Japanese texts by extension, chi or ki refers to manifested chi or force. The manifested chi in Chinese texts is called jing (muscular power), jinli (martial power), or jin ( combination of emitted chi and muscular power applied to a specific target spot). daiki taiyu: divine transformation. Usually, transformation from potential or resting energy to active motion and force. human, or heaven in Chinese philosophy. chudan: sword held in middle position gedan: sword held tilted down ha: attack hachimaki: headband hakarigoto: "strategy" hakama: pleatted skirt or culottes, usually worn for exercise. hara: navel or belly heihou : “strategy”, literal “dark hidden deception” hiro: color ho:martial art hyori: deception inka: martial arts diploma isshin, “One Mind” isshin itto, “One Heart, One Sword” kan: listening with mind and contemplative insight. ken: sword or used as homonym for “plain sight or ordinary sight” as opposed to contemplative insight (kan). kendo:way of the sword kenjutsu : swordsmanship. kannen:mind should see through one’s emotions or mind should be clear of emotions. kizen:”take initiative” jo: preliminary attack jodan:sword held above forehead kage-ryu: shadow sword style, sometimes refers to following, reacting, and basing actions on opponent’s shadow. Especially, staying outside opponent’s cast shadow until closing for attack. kami: shinto diety or dieties kanshin: seeing with mind or insight. katana: long sword. katsu: refers to attainment of essential nature or “Life-Giving” katsujinken: “Life-Giving-Sword”, sometimes refers to resolution of problems without force. ken: sword kenshogodo: seeing into essential nature. ki: vital energy kiai: focused shouts, loud scream used to disturb opponent. koku: empty space kyusho: vital point kuji: 9 hand signs or mudras used in kendo training. kyu: counter strike majutsu, techniques of invisibility mondo: question and answer in Zen dialogue. mu: “Non-existence”, sometimes refers to Yin side (left) of opponent or hidden side (shadow) of object. mu-kyu: “Non-existence counterstrike”, sometimes refers to circling counterclockwise (in Yin direction) around opponent for one or more paces and attacking the “Non-Existence” (left,Yin) side of the opponent. Here, “Existence” may refer to sword held by right handed swordsman and “Non-Existence” may either refer to empty hand on left side or the palm of the right sword hand viewed from the left (by the opponent). munen muso: (literal) No-Desires, No-Thought muto: “No-Sword”, sometimes refers to resolution of problems without force. Also techniques of unarmed combat. munen: “No-Thought” or refers to actions under suspension of consciousness. mushin, "No-Mind", suspension of consciousness, usually during meditation. mushinjo: suspension of consciousness, usually during meditation. myo (na) : strange, odd, without reason naginata, long spear with heavy blade. nakazumi: “mysterious-sword” is holding sword around navel or hara. nitto ryu: “two-swords-style” ryu: sword style or school satori: "enlightenment" setsuninken: “death-dealing-sword”, sometimes refers to solving problems by force only as opposed to solving problems without force. satsuninto: “death-dealing-sword”, sometimes refers to solving problems by force only as opposed to solving problems without force. seiza:kneeling position for meditation practice sensei:teacher shin: mind shinken: “Real-Sword”. shinken sho-bu: contests with “Real-Sword”. shinku: emptiness of mind shinmyo: “Mysterious”, refers to the combination of mind (shin) and strange outside action (myo). Usually found in combination as “Mysterious-Sword” or implied sword. shinmyoken: “Mysterious-Sword” , refers to the combination of mind (shin) and strange outside action (myo) holding the sword (ken) around navel, just as hara is considered center of being/energy. suigetsu, literally moon on water, refers to keeping 3 pace distance from opponent or out of opponent’s cast shadow. Note: sun and moon both cast shadows. shuji: crosspattern sword block (literal from Sino. characters, hand ji (noun suffix)). Sometimes refers to crosscounterpoint target on body of opponent. shujishuriken: (literal from Sino. characters, hand ji (noun suffix) hand inside see) perception of abilities and intentions. By extension, see inside technique of opponent. Sometimes refers to the 9 healing sounds and ideographs (mudras) used to increase alertness, warmup shoulders, and loosen hands prior to combat. tachi: great sword tsumeru: deflection or block leading to counterstrike. not a hard block. yang: positive energy or active principle . heavenly energy. clockwise movement. yin: negative energy or inactive principle. earthly energy, counterclockwise movement. tai: substance or fundamental property of all things tao: way of philosophy wakizashi: sidearm sword or short sword yari: spear zazen: meditation practice zen: meditation practice towards Self-Realization Katsujinken, “life-giving-sword by Yagyu Munori,C. 1632 CE”.Heiho Kadensho of Yagyu Munenori.Also known as Yagyu Family Memorial text in paraphrased Romanji terms, kk kk k lll jjj kkk bbb bb nn nnn mmm mmm mmm mmm

From a clay tablet, internal and external volumes of a hollow cylinder is equated to squared ratio of radius1*radius1 over radius2*radius2. Not sure about the accurate math derivation and maybe numerical coincidence, but the tablet appears to be using inner volume equals outer volume times radius1*radius1 over radius2*radius2. Hereafter, the paragraph will use the modern decimal notation, PI (3.14...), and carry extra decimal points from the eTCL calculator, whereas the Sumerians used 3 and round numbers. radius1 would be the radius of the hollow and radius2 would be the radius of the outer cylinder. In the tablet, the circumference of the outer cylinder was 1.5 units and the ratio of the inner radius to outer radius would be 1:4. The diameter of the outer cylinder would be 1.5/PI or 0.4774, and radius2 would be 0.4774/2 or .2387. radius1 would be .2387/4 or 0.0597. The height of the cylinder would be 1 unit. Using conventional formulas the volume of the outer cylinder would be 2*PI*radius2*radius2*height, substituting 2*3.14*.2387*.2387*1, 0.3578. The conventional volume of the inner cylinder would be 2*PI*radius2*radius2*height, substituting 2*3.14*.0597*.0597*1, 0.0224. The volume of the hollow cylinder would be outer cylinder minus inner cylinder, 0.3578-0.0224, 0,3354. In squared proportions, the radius1*radius1 over radius2*radius2 would be (1*1)/(4*4),1/16,0.0625. The Sumerians found the inner cylinder vol (hollow) as (1/16) * outer cylinder vol, (1/16) * 0.3578, 0.0224 in modern notation. Not on the tablet, but it follows that the hollow or outer cylinder volume would be (1-1/16)* outer cylinder vol, (15/16)* 0.3578, 0.3354.

In Sumerian base60, the factor would be 1/16 or 3/60+45/3600.
    set inner_cylinder_a=b*(c*c/d*d)_  [* 0.3578 [/  [* 1. 1.  ] [* 4. 4.  ]   ]] # 0.0223625
    set hollow_cylinder_a=b*(c*c/d*d)_  [* 0.3578 [- 1. [/  [* 1. 1.  ] [* 4. 4.  ]]   ]] # 0.3354375
    set inner_cylinder_  [ eval expr 2*[pi]*.0597*.0597*1 ] # 0.0224
    set outer_cylinder_  [ eval expr 2*[pi]*.2387*.2387*1 ] # 0.3578

derivation setup
     barge_area =2*((pi*r*r/4)-r*r/2) # 2 times segment of  circle for quarter section.
     
     barge_area = coefficient * circumference * circumference
     coefficient = barge_area / ( circumference * circumference)
     coefficient =   ((2*pi*r*r/4)-2*(r*r/2) ) / ( 2*pi*r * 2*pi*r )
     coefficient =   (1/(4*PI*PI*r*r)*(2*pi*r*r/4) - (1/(4*PI*PI*r*r)* (2*r*r/2)
     reduction >>  coefficient = 1/(8*PI)- 1/( 4*PI*PI )
     Sumerian 3 for PI, coefficient = 1/24-1/36 
     ??? Sumerian text  = 2/9 ,  2/9 = 0.2222 decimal, base60 value = 13/60+ 20/3600   
     #   derivation or problem of concave square, r=.5, d=1.0, ref Robson and Friberg
     # square of unit one on side minus 4 quarter circles of radius = 0.5,sumerian pi = 3.
     set concave_square_coefficient_modern_notation [ eval expr 1. - 4.* (1./4.)*[pi]*.5*.5 ]
     # decimal answer= 0.21460183660255172
     set concave_square_coefficient_babylonian_notation [ eval expr 1. - 4.*(1./4.)* 3.*.5*.5 ]
     # decimal answer= 0.25, conv .25*60 ???
     # above was defining bound for radius=.5, but problem wants quarter circle arc equal one. 
     # coefficient is 4 times area of inscribed quarter_circle with arc of quarter_circle set to 1.
      set concave_square_coeff  [ eval expr (2.*[pi] )**2. - (2.*[pi] )**2. ]
     Sumerian text = concave_square_coefficient  = base60 26_40,  4/9

Uses of even powers (eg 2**2 and 3**2). Several Babylonian tables of powers have been published. Some of these tables are equivalent to even powers of prime numbers. For example the table of nines would give numbers, equivalent to even powers of 3. The table of 16 would give equivalent numbers based on even powers of 2. Conjecture is that these tables could have been used to generate Babylonian triplets. Ref, Babylonian Pythagorean Triplets by Michael Fowler.
# following statements can be pasted into eTCL console
set aside [expr 3**4-2**6] # 17 
set cside [expr 3**4+2**6] # 145
set bside [expr 2*(3**2)*(2**3)] # 144
# 3**4 => 9**2
# 2**6 => 16**1
set aside [expr 3**6-2**12] # 3367 
set cside [expr 3**6+2**12] # 4825
set bside [expr 2*(3**3)*(2**6)] # 3456
#3**6  => 9**3
#2**12 => 4093 +> 16**3
# The next even power of 3 would be 3**8 and next step? might be 16**4?
# 12709,13500,18548, 2 2 • 3 3 • 5 3 
set bside [expr 2*( ** )*( ** )]# 
set bside [expr 2*(3**3)*(2**8)]  #  13500
set cside [expr 125**2+54**2]    #  18541
set aside [expr 125**2-54**2]  #   12709 
#12709 71 179 13500 2 2 3 3 3 5 5 5 18548  2 2 4637 

Following one liners need mathops and math libraries edit

proc list_squares { aa bb} { for {set i 1} {$i<=$bb} {incr i} {lappend booboo [ * $i  $i 1. ] };return $booboo}
(tclprograms) 14 % list_squares 1 5
1.0 4.0 9.0 16.0 25.0
proc listnumbers { aa bb} { for {set i 1} {$i<=$bb} {incr i} {lappend booboo [ expr 1.* $i] };return $booboo}
 #returns list of integer numbers from aa to bb as reals with decimals,usage [listnumbers 1 5] , answer is 1.0 2.0 3.0 4.0 5.0 
proc listfib { aa bb} { for {set i 1} {$i<=$bb} {incr i} {lappend booboo [ int [ binet $i] ] };return $booboo} 
proc binet { n} {set n [int $n ]; return [int [*  [/ 1 [sqrt 5]]  [- [**  [/   [+ 1 [sqrt 5]] 2 ] $n ]  [** [/   [- 1 [sqrt 5]] 2 ]  $n ] ] ] ] } 
# usage,  set binet1  [ binet 8],answer 21,   removing int's will return real numbers
# usage,  set fibno  [ listfib 1 8 ], answer 1 1 2 3 5 8 13 21  
proc fibonacci_approx_for_large_N {n} { set phi [/   [+ 1 [sqrt 5]] 2 ]  ; return [/  [** $phi  $n   ] [sqrt 5 ]] } 
% proc fibonacci_approx_for_large_N {n} { set phi [/   [+ 1 [sqrt 5]] 2 ]  ; return [int  [/  [** $phi  $n   ] [sqrt 5 ]]] } 
(tclprograms) 8 % [fibonacci_approx_for_large_N 1]   
invalid command name "0.7236067977499789"
(tclprograms) 9 % [fibonacci_approx_for_large_N 2]
invalid command name "1.1708203932499368"
(tclprograms) 10 %  [fibonacci_approx_for_large_N 3]
invalid command name "1.8944271909999157"
(tclprograms) 11 % [fibonacci_approx_for_large_N 4]
invalid command name "3.065247584249853"
proc add {args} {return [ ::tcl::mathop::+ 0. {*}$args]};
(tclprograms) 2 % add 12 11 10 9 8 7 6 5 4 3 2 1
78.0
             console show
             package require math::numtheory
             #namespace path {math::numtheory}
             namespace path {::tcl::mathop ::tcl::mathfunc math::numtheory }
             set tcl_precision 17
         proc square_root_function { number_for_root  } {   
             set counter 0
             set epsilon .0001
             while { $counter < 50.  } {
             if { [* $counter $counter 1. ]   > [* $number_for_root 1.] } {break}            
             incr counter 
             }   
             set  square_root_estimate $counter
             while {1} {
             set keeper $square_root_estimate        
             set starter $square_root_estimate
             set remainder   [* $starter $starter  1. ]  
             set remainder [- $number_for_root [* $starter $starter  1. ] ]
             set  square_root_estimate  [+ $starter [/ $remainder [* 2. $starter ]]]
             if {abs($keeper - $square_root_estimate) < $epsilon} break
                   }
             return $square_root_estimate
                }

gold Here is some eTCL starter code for Babylonian Square Side Rule & Diagonal Algorithm in calculator shell.

The Babylonian Square Side Rule from clay tablets was loaded into an eTCL calculator shell. The Babylonian Square Side Rule is of historical interest, but the rule is not very accurate and dependent on an initial input or guess. The square side rule with a single trial input becomes less accurate with increasing N. In some math problems, the Babylonians used the Square Side Rule for calculating the diagonals of squares and rectangles. The Babylonians did not use algebra notation, so the reader will have to bear some anachronisms in the eTCL pseudocode. Succesive or iterated math solutions are called algorithms and the Square Side Rule procedure is one of the earliest algorithms documented. The TCL procedures are descendants of this idea.

In the Babylonian problem texts on clay tablets, there are numbers and coefficients which were used in determining geometric dimensions, the amount of materials, and the daily work rates of the workers. One difficulty is determining the effective power of the numbers in base 60. For example, 20 could represent either 20*3600, 20*60, 20, 20/60, 20/3600, or even 1/20. The basic dimensions of geometric figures and final tallies were presented in the Babylonian accounts on clay tablets, but sometimes the calculations were left off the tablet, broken off, or garbled. At least one approach for the modern reader and using modern terminology is to develop the implied algebraic equations from the Babylonian numbers. Then the eTCL calculator can be run over a number of testcases to validate the algebraic equations. In the eTCL code, extra significant digits are retained to check the function errors, but not to imply greater precision in the algorithm.

For the first testcase of sqrt 2, the initial trial_square_root entry of 2 gave an error of 6.06 percent. For the second testcase of sqrt 10, the initial trial_square_root entry of 3 gave an error of 0.138 percent. For the third testcase, the initial trial_square_root entry of 9 gave an error of 0.555 percent. An iterative solution with successive trial_square_root entries loaded as 9, 10.05555, and 10.000153437 showed 1.177E-8 percent error in three interations.

In a previous wiki page, an eTCL calculator was used to generate Babylonian triplets which are examples from the tablet Plimpton 322 and many other papers. Mansfield and Wildberger have postulated that the Babylonian triplet listings in Plimpton 322 and auxiliary triplets were used in determining the diagonals and side ratios of right triangles, ref below. Not sure I comprehend all the Mansfield and Wildberger efforts, but an eTCL calculator could be adapted to generate the Babylonian triplet table and calculate the diagonals and side ratios of right triangles from a subset of numbers, compatible with the standard reciprocal table. There is a infinite set of right triangles, but a finite subset of right triangle and side ratios that can be manipulated with the sexagesimal positive integer subset in Babylonian standard reciprocal table.

Model problem for tablet Plimpton 322 ) Setting up model problem with a priori knowledge. A right triangle has known sides of diagonal 15, base 12, and unknown short side (9). Pythagorean theorem is given in TCL format below. Alternate method if a similar triangle can be found, the sides of similar triangles can be solved by ratios. The numbers for diagonal 15 and base 12 can be factored as 3*5 and 2*2*3. The factor of 3 is found in diagonal and base, reduction to sides 5 and 4. If triangle is similar to 5:4:3, then unknown side is 3*3 or 9.
          set solution [sqrt [- [* 15. 15.] [* 12. 12. ]] ] # answer 9.
          # using pseudocode on similar triangles
          2 quantities needed and lookup table
          entries for diagonal_side and long_side
          posit solution exists between 2 similar triangles in look up table
          factor sides 15 and 12 as 3*5 and 2*2*3
          TCL procedure can factor diagonal and long side
          here in trial code, all factors are low primes
          solution of short_side as large single prime is possible
          apparently, infinite numbers of primes exist as possible short_sude,
          >> if not limited in table <<
          if beyond table, solution will not be found
          find common factor of 3
          unknown side from similar 5:4:3 triangle is 3 times 3
          for B. ss.  solution, short_side = diagonal * (1/(3*5) & long_side *(1/(2*2*3) 
            trial_square_root,   w.a. guess
            formula factor , usually 2 or 3
            quantity "rooty? lacking one" from 322 tablet
            Babylonian trial formula from square side rule
            set approximate_rooty [* [/ 1. $formula_factor ] [+ [* [/ 1. $trial_square_root ] $target_number] $trial_square_root ]   ]
            set function(diagonal) = (1/2)*(diagonal*(1/guess) + guess)
            set function(diagonal) = (1/2)*(diagonal*(1/long_side) + long_side)
            set function(diagonal) = (1/2)*(3*5*(1/(2*2*3)) +2*2*3)
            set function(diagonal) = (1/2)*(5*(1/(2*2)) +2*2*3),  (1/2)*(5/4+12) or 6
            iteration > set function(diagonal) = (1/2)*(5*(1/(6)) +6),  (1/2)*(5/6+6) or 3+5/12
            possible reduction of formula
            by either small prime factors or other large  prime factors
            set side5  $trial_square_root
            set side6 [+ [* [/ 1. $trial_square_root ] $target_number] $trial_square_root ]  
            set side7 [* [/ 1. $formula_factor ]] 
     check approx. rooty with sqrt function in TCL

By inspection in modern terms and decimal notation, the numbers on the remaining part of the Plimpton tablet ranged in magnitude from 3 to 18548 and fitted into a right triangles give acute angles from 44.8 to 31.3 degrees. In the translations and this page, the term diagonal is preferred to hypotenuse of a right triangle. On the Plimpton tablet, there are many prime numbers in the extant triplets, as noticed in several papers. A triangle with common factors on the diagonal and the other two sides can be reduced into a similar triangle. A triangle with a prime number on any side (and the prime number not a common factor) cannot be reduced further.

Pseudocode Section edit

    # using  pseudocode for Babylonian procedure algorithm.
            3 quantities needed
            target number
            trial_square_root,   w.a. guess
            formula factor , usually 2 or 3
            set approximate_root [* [/ 1. $formula_factor ] [+ [* [/ 1. $trial_square_root ] $target_number] $trial_square_root ]   ]
            set side5  $trial_square_root
            set side6 [+ [* [/ 1. $trial_square_root ] $target_number] $trial_square_root ]  
            set side7 [* [/ 1. $formula_factor ]] 
     check approx. root from square side rule with sqrt function in TCL
     ref. errorx procedure        
     check_answer   new area =? desired goal , desired goal reached (yes/no)
     set answers and printout with resulting values

Testcases Section

In planning any software, it is advisable to gather a number of testcases to check the results of the program. The math for the testcases can be checked by pasting statements in the TCL console. Aside from the TCL calculator display, when one presses the report button on the calculator, one will have console show access to the capacity functions (subroutines).

Testcase 1

table 1printed in tcl wiki format
quantity value comment, if any
1:testcase_number
2.0 :target number N
2.0 :trial square root
2.0 :function factor
3.0 :answers: intermediate term in formula
4.0 :trial square
1.4142135623730951 :square root from TCL sqrt function
6.0660171779821193 :percentage error
1.5 :approximate square root from square side rule

Testcase 2

table 2printed in tcl wiki format
quantity value comment, if any
2:testcase_number
10.0 :target number N
3.0 :trial square root
2.0 :function factor
6.333333333333333 :answers: intermediate term in formula
9.0 :trial square
3.1622776601683795 :square root from TCL sqrt function
0.13879257199866935 :percentage error
3.1666666666666665 :approximate square root from square side rule

Testcase 3

table 3printed in tcl wiki format
quantity value comment, if any
3:testcase_number
100.0 :target number N
9.0 :trial square root
2.0 :function factor
20.111111111111111 :answers: intermediate term in formula
81.0 :trial square
10.0 :square root from TCL sqrt function
0.55555555555555358 :percentage error
10.055555555555555 :approximate square root from square side rule

Screenshots Section

figure 1.


References:

  • Daniel F. Mansfield , N.J. Wildberger.
  • Plimpton 322 is Babylonian exact sexagesimal trigonometry.
  • Ref. square side rule
  • Historia Mathematica, August 2017 DOI: 10.1016/j.hm.2017.08.001
  • Newsweek, Babylonian Tablet Could Hold Mathematical
  • Secrets For Today's Researchers, Josh Lowe , 8/25/17
  • Plimpton 322 Tablet and the Babylonian Method of
  • Generating Pythagorean Triples,
  • Abdulrahman A. Abdulaziz, University of Balamand, 2010
  • Seaching for Babylonian Triplets Slot Calculator Example
  • Babylonian trailing edge algorithm and reverse sequence algorithm for reciprocals, eTCL demo example calculator, numerical analysis
  • [Babylonian Field Expansion Procedure Algorithm and eTCL demo example calculator, numerical analysis]
  • [Babylonian False Position Algorithm and eTCL demo example calculator, numerical analysis]
  • A Geometric Algorithm with Solutions to Quadratic Equations
  • in a Sumerian Juridical Document from Ur III Umma
  • Joran Friberg, Chalmers University of Technology, Gothenburg, Sweden
  • google search engine <Trapezoid area bisection>
  • Wikipedia search engine <Trapezoid area >
  • mathworld.wolfram.com, Trapezoid and right trapezoid
  • Mathematical Treasure: Old Babylonian Area Calculation, uses ancient method
  • Frank J. Swetz , Pennsylvania State University
  • Wikipedia, see temple of Edfu, area method used as late as 200 BC in Egypt.
  • Wikipedia, Methods of computing square roots,
  • Ref. square side rule also known as Babylonian method or Heron's method
  • Another simple database
  • Richard Suchenwirth
  • editRecord
  • Oneliner's Pie in the Sky, ref. errorx procedure
  • One Liners
  • Category Algorithm
  • Square Root
  • [Babylonian Number Series and eTCL demo example calculator]
  • Brahmagupta Area of Cyclic Quadrilateral and eTCL demo example calculator
  • Gauss Approximate Number of Primes and eTCL demo example calculator
  • Land surveying in ancient Mesopotamia, M. A. R. Cooper
  • [Sumerian Approximate Area Quadrilateral and eTCL Slot Calculator Demo Example , numerical analysis]
  • Thomas G. Edwards, Using the Ancient Method of False Position to Find Solutions
  • Joy B. Easton, rule of double false position
  • Vera Sanford, rule of false position
  • www.britannica.com, topic, mathematics trapezoid
  • [Sumerian Equivalency Values, Ratios, and the Law of Proportions with Demo Example Calculator]
  • Babylonian Sexagesimal Notation for Math on Clay Tablets in Console Example
  • Late Babylonian Field Plans in the British Museum, books.google.com/books
  • Karen Rhea Nemet-Nejat
  • Late Babylonian Surface Mensuration Author(s): Marvin A. Powell Source: jstor
  • Poles and walls in Mesopotamia and Egypt , Melville,
  • www.sciencedirect.com/science/article
  • Pythagorean ‘Rule’ and ‘Theorem’ – Mirror of the Relation Between Babylonian and Greek Mathematics,
  • Jens Høyrup, Roskilde University
  • On Plimpton 322. Pythagorean numbers in Babylonian mathematics, E. M. Bruins
  • PLIMPTON 322: A UNIVERSAL CUNEIFORM TABLE FOR OLD BABYLONIAN
  • MATHEMATICIANS, BUILDERS, SURVEYORS AND TEACHERS
  • Rudolf Hajossy

Appendix Code edit

appendix TCL programs and scripts

        # pretty print from autoindent and ased editor
        # Babylonian Square Side Rule calculator
        # written on Windows XP on eTCL
        # working under TCL version 8.5.6 and eTCL 1.0.1
        # gold on TCL WIKI, 2oct2017
        package require Tk
        package require math::numtheory
        namespace path {::tcl::mathop ::tcl::mathfunc math::numtheory }
        set tcl_precision 17
        frame .frame -relief flat -bg aquamarine4
        pack .frame -side top -fill y -anchor center
        set names {{} {target number N :} }
        lappend names {trial square root:}
        lappend names {formula factor: }
        lappend names {answers: intermediate term in formula }
        lappend names {trial square :}
        lappend names {square root from TCL sqrt function : }
        lappend names {percentage error: }
        lappend names {approximate square root from square side rule :} 
        foreach i {1 2 3 4 5 6 7 8} {
            label .frame.label$i -text [lindex $names $i] -anchor e
            entry .frame.entry$i -width 35 -textvariable side$i
            grid .frame.label$i .frame.entry$i -sticky ew -pady 2 -padx 1 }
        proc about {} {
            set msg "Calculator for Square Side Rule
            from TCL WIKI,
            written on eTCL "
            tk_messageBox -title "About" -message $msg } 
       proc ::tcl::mathfunc::precision {precision float}  {
            #  tcl:wiki:Floating-point formatting, [AM]
            set x [ format "%#.5g" $float ]
            return $x
           }   
            #proc errorx always returns a positive error. 
            #Normally assume $aa is human estimate,
            #assume $bb is divinely exact.
       proc errorx  {aa bb} {expr { $aa > $bb ?   (($aa*1.)/$bb -1.)*100. : (($bb*1.)/$aa -1.)*100.}}
       proc calculate {     } {
            global answer2
            global side1 side2 side3 side4 side5
            global side6 side7 side8 
            global testcase_number
            incr testcase_number 
            set side1 [* $side1 1. ]
            set side2 [* $side2 1. ]
            set side3 [* $side3 1. ]
            set side4 [* $side4 1. ]
            set side5 [* $side5 1. ]
            set side6 [* $side6 1. ]
            set side7 [* $side7 1. ]
            set side8 [* $side8 1. ]
            set target_number $side1
            set trial_square_root $side2
            set formula_factor $side3
       set approximate_root [* [/ 1. $formula_factor ] [+ [* [/ 1. $trial_square_root ] $target_number] $trial_square_root ]   ]
            set side4 [+ [* [/ 1. $trial_square_root ] $target_number] $trial_square_root ]  
            set side5 [* $trial_square_root $trial_square_root]
            set side6 [sqrt $target_number ]  
            set side7 [ errorx $approximate_root [sqrt  $target_number ]   ]
            set side8 $approximate_root
                    }
        proc fillup {aa bb cc dd ee ff gg hh} {
            .frame.entry1 insert 0 "$aa"
            .frame.entry2 insert 0 "$bb"
            .frame.entry3 insert 0 "$cc"
            .frame.entry4 insert 0 "$dd"
            .frame.entry5 insert 0 "$ee"
            .frame.entry6 insert 0 "$ff" 
            .frame.entry7 insert 0 "$gg"
            .frame.entry8 insert 0 "$hh" 
             }
        proc clearx {} {
            foreach i {1 2 3 4 5 6 7 8 } {
                .frame.entry$i delete 0 end } }
        proc reportx {} {
            global answer2
            global side1 side2 side3 side4 side5
            global side6 side7 side8
            global testcase_number
            console show;
            puts "%|table $testcase_number|printed in| tcl wiki format|% "
            puts "&| quantity| value| comment, if any|& "
            puts "&| $testcase_number:|testcase_number | |&"
            puts "&| $side1 :|target number N  |   |&"
            puts "&| $side2 :|trial square root | |& "  
            puts "&| $side3 :|function factor | |& "
            puts "&| $side4 :|answers: intermediate term in formula| |&"
            puts "&| $side5 :|trial square | |&"
            puts "&| $side6 :|square root from TCL sqrt function |  |&"
            puts "&| $side7 :|percentage error |  |&"
            puts "&| $side8 :|approximate square root from square side rule |  |&" 
            }
        frame .buttons -bg aquamarine4
        ::ttk::button .calculator -text "Solve" -command { set side8 0 ; calculate   }
        ::ttk::button .test2 -text "Testcase1" -command {clearx;fillup 2.  2.0  2.0 3.0  4.0   1.414    6.066  1.5}
        ::ttk::button .test3 -text "Testcase2" -command {clearx;fillup 10.0 3.0 2.0 6.333 9.0   3.162 0.138     3.166}
        ::ttk::button .test4 -text "Testcase3" -command {clearx;fillup 100.0 9.0 2.0  20.111  81.0    10.0  0.5555  10.0555}
        ::ttk::button .clearallx -text clear -command {clearx }
        ::ttk::button .about -text about -command {about}
        ::ttk::button .cons -text report -command { reportx }
        ::ttk::button .exit -text exit -command {exit}
        pack .calculator  -in .buttons -side top -padx 10 -pady 5
        pack  .clearallx .cons .about .exit .test4 .test3 .test2   -side bottom -in .buttons
        grid .frame .buttons -sticky ns -pady {0 10}
               . configure -background aquamarine4 -highlightcolor brown -relief raised -border 30
        wm title . "Babylonian Square Side Rule Calculator"          

Pushbutton Operation

For the push buttons, the recommended procedure is push testcase and fill frame, change first three entries etc, push solve, and then push report. Report allows copy and paste from console.

For testcases in a computer session, the eTCL calculator increments a new testcase number internally, eg. TC(1), TC(2) , TC(3) , TC(N). The testcase number is internal to the calculator and will not be printed until the report button is pushed for the current result numbers. The current result numbers will be cleared on the next solve button. The command { calculate; reportx } or { calculate ; reportx; clearx } can be added or changed to report automatically. Another wrinkle would be to print out the current text, delimiters, and numbers in a TCL wiki style table as
  puts " %| testcase $testcase_number | value| units |comment |%"
  puts " &| volume| $volume| cubic meters |based on length $side1 and width $side2   |&"  

console program for Newton's Method

        # gold on TCL WIKI, 2oct2017
        # console program for square root
        # additional verbose Newton's Method
        package require Tk
        package require math::numtheory
        set tcl_precision 17
             console show
             namespace path {::tcl::mathop ::tcl::mathfunc math::numtheory }
         proc square_root_function { number_for_root  } {   
             set counter 0
             set epsilon .0001
             while { $counter < 50.  } {
             if { [* $counter $counter 1. ]   > [* $number_for_root 1.] } {break}            
             incr counter 
             }   
             set  square_root_estimate $counter
             while {1} {
             set keeper $square_root_estimate        
             set starter $square_root_estimate
             set remainder   [* $starter $starter  1. ]  
             set remainder [- $number_for_root [* $starter $starter  1. ] ]
             set  square_root_estimate  [+ $starter [/ $remainder [* 2. $starter ]]]
             if {abs($keeper - $square_root_estimate) < $epsilon} break
                   }
             return $square_root_estimate
                }     
            puts " [ square_root_function 10. ] "

Version 2 Diagonal calculator with extended and modified Plimpton 322 dataset

        # pretty print from autoindent and ased editor
        # Babylonian Square Side Rule & Diagonal calculator,  Version 2
        # Version 2 tests database invoke
        # from modified and extended Plimpton 322 dataset
        # dataset includes numbers not on original tablet
        # Using Suchenworth code from Another Database, TCL WIKI
        # written on Windows XP on eTCL
        # working under TCL version 8.5.6 and eTCL 1.0.1
        # gold on TCL WIKI, 2oct2017
        package require Tk
        package require math::numtheory
        namespace path {::tcl::mathop ::tcl::mathfunc math::numtheory }
        set tcl_precision 17
        frame .frame -relief flat -bg aquamarine4
        pack .frame -side top -fill y -anchor center
        set names {{} {target number N :} }
        lappend names {trial square root:}
        lappend names {formula factor: }
        lappend names {answers: intermediate term in formula }
        lappend names {trial square :}
        lappend names {square root from TCL sqrt function : }
        lappend names {percentage error: }
        lappend names {approximate square root from square side rule :} 
        foreach i {1 2 3 4 5 6 7 8} {
            label .frame.label$i -text [lindex $names $i] -anchor e
            entry .frame.entry$i -width 35 -textvariable side$i
            grid .frame.label$i .frame.entry$i -sticky ew -pady 2 -padx 1 }
        proc about {} {
            set msg "Calculator for Square Side Rule
            from TCL WIKI,
            written on eTCL "
            tk_messageBox -title "About" -message $msg } 
       proc ::tcl::mathfunc::precision {precision float}  {
            #  tcl:wiki:Floating-point formatting, [AM]
            set x [ format "%#.5g" $float ]
            return $x
           }   
            #proc errorx always returns a positive error. 
            #Normally assume $aa is human estimate,
            #assume $bb is divinely exact.
       proc errorx  {aa bb} {expr { $aa > $bb ?   (($aa*1.)/$bb -1.)*100. : (($bb*1.)/$aa -1.)*100.}}
       proc calculate {     } {
            global answer2
            global side1 side2 side3 side4 side5
            global side6 side7 side8 
            global testcase_number
            incr testcase_number 
            set side1 [* $side1 1. ]
            set side2 [* $side2 1. ]
            set side3 [* $side3 1. ]
            set side4 [* $side4 1. ]
            set side5 [* $side5 1. ]
            set side6 [* $side6 1. ]
            set side7 [* $side7 1. ]
            set side8 [* $side8 1. ]
            set target_number $side1
            set trial_square_root $side2
            set formula_factor $side3
       set approximate_root [* [/ 1. $formula_factor ] [+ [* [/ 1. $trial_square_root ] $target_number] $trial_square_root ]   ]
            set side4 [+ [* [/ 1. $trial_square_root ] $target_number] $trial_square_root ]  
            set side5 [* $trial_square_root $trial_square_root]
            set side6 [sqrt $target_number ]  
            set side7 [ errorx $approximate_root [sqrt  $target_number ]   ]
            set side8 $approximate_root
                    }
        proc fillup {aa bb cc dd ee ff gg hh} {
            .frame.entry1 insert 0 "$aa"
            .frame.entry2 insert 0 "$bb"
            .frame.entry3 insert 0 "$cc"
            .frame.entry4 insert 0 "$dd"
            .frame.entry5 insert 0 "$ee"
            .frame.entry6 insert 0 "$ff" 
            .frame.entry7 insert 0 "$gg"
            .frame.entry8 insert 0 "$hh" 
             }
        proc clearx {} {
            foreach i {1 2 3 4 5 6 7 8 } {
                .frame.entry$i delete 0 end } }
        proc reportx {} {
            global answer2
            global side1 side2 side3 side4 side5
            global side6 side7 side8
            global testcase_number
            console show;
            puts "%|table $testcase_number|printed in| tcl wiki format|% "
            puts "&| quantity| value| comment, if any|& "
            puts "&| $testcase_number:|testcase_number | |&"
            puts "&| $side1 :|target number N  |   |&"
            puts "&| $side2 :|trial square root | |& "  
            puts "&| $side3 :|function factor | |& "
            puts "&| $side4 :|answers: intermediate term in formula| |&"
            puts "&| $side5 :|trial square | |&"
            puts "&| $side6 :|square root from TCL sqrt function |  |&"
            puts "&| $side7 :|percentage error |  |&"
            puts "&| $side8 :|approximate square root from square side rule |  |&" 
            }
        frame .buttons -bg aquamarine4
        ::ttk::button .calculator -text "Solve" -command { set side8 0 ; calculate   }
        ::ttk::button .test2 -text "Testcase1" -command {clearx;fillup 2.  2.0  2.0 3.0  4.0   1.414    6.066  1.5}
        ::ttk::button .test3 -text "Testcase2" -command {clearx;fillup 10.0 3.0 2.0 6.333 9.0   3.162 0.138     3.166}
        ::ttk::button .test4 -text "Testcase3" -command {clearx;fillup 100.0 9.0 2.0  20.111  81.0    10.0  0.5555  10.0555}
        ::ttk::button .clearallx -text clear -command {clearx }
        ::ttk::button .about -text about -command {about}
        ::ttk::button .cons -text report -command { reportx }
        ::ttk::button .exit -text exit -command {exit}
        pack .calculator  -in .buttons -side top -padx 10 -pady 5
        pack  .clearallx .cons .about .exit .test4 .test3 .test2   -side bottom -in .buttons
        grid .frame .buttons -sticky ns -pady {0 10}
               . configure -background aquamarine4 -highlightcolor brown -relief raised -border 30
        wm title . "Babylonian Square Side Rule Calculator"          
       # Start diagonal solver code
       proc select {fields "from" tbl "where" condition} {
       #Suchenworth subroutine code from Another Database, TCL WIKI
       set infields [lindex $tbl 0]
       if {$fields eq "*"} {set fields $infields}
       set res [list $fields]
       foreach inrow [lrange $tbl 1 end] {
          foreach $infields $inrow break
          if $condition {
            set row {}
            foreach field $fields {lappend row [set $field]}
            lappend res $row
        }
        }
       set res
       }
       set table {
      {number fraction_squares long_side short_side  diagonal_side suppose_angle line }
      { 1 .9834028 120 119 169 44.76 1 }
      { 2 .9491586 3456 3367 4825 44.25 2 }
      { 3 .9188021 4800 4601 6649 43.79 3 }
      { 4 .8862479 13500 12709 18541 43.27 4 }
      { 5 .8150077 72 65 97 42.08 5 }
      { 6 .7851929 360 319 481 41.54 6 }
      { 7 .7199837 2700 2291 3541 40.32 7 }
      { 8 .6927094 960 799 1249 39.77 8 }
      { 9 .6426694 600 481 769 38.72 9 }
      { 10 .5861226 6480 4961 8161 37.44 10 }
      { 11 .5625 60 45 75 36.87 11 }
      { 12 .4894168 2400 1679 2929 34.98 12 }
      { 13 .4500174 240 161 289 33.86 13 }
      { 14 .4302388 2700 1771 3229 33.26 14 }
      { 15 .3871605 90 56 106 31.89 15 }
      { 16 .1 1 175 337 1 16 }
      { 17 .1 1 473 985 1 17 }
      { 18 .1 1 1679 2929 1 18 }
      { 19 .1 1 161 289 1 19 }
      { 20 .1 1 1771 3229 1 20 }
      { 21 .1 1 56 106 1 21 }
      { 22 .1 1 4961 8161 1 22 }
      { 23 .1 1 1 75 1 23 }
      { 24 .1 1 1679 2929 1 24 }
      { 25 .1 1 161 289 1 25 }
      { 26 .1 1 1771 3049 1 26 }
      { 27 .1 1 301 949 1 27 }
      { 28 .1 1 329 1129 1 28 }
      { 29 .1 1 7 25 1 29 }
      { 30 .1 1 399 1649 1 30 }
      { 31 .1 1 9 41 1 31 }
      { 32 .1 1 11 61 1 32 }
      { 33 .1 1 295 1753 1 33 }
      { 34 .1 1 17 145 1 34 }
      { 35 .1 1 19 181 1 35 }
      { 36 .1 1 52 677 1 36 }
      { 37 .1 1 31 481 1 37 }
      { 38 .1 1 49 1201 1 38 }
      }
      puts [ select * from $table where {$line < 100} ]
      puts [ select {diagonal_side short_side } from $table where {$line != 15} ]

comma delimited spreadsheet of extended Plimpton 322

number,fraction_squares,long_side,short_side,diagonal_side,suppose_angle,line
1,0.9834028,120,119,169,44.76,1
2,0.9491586,3456,3367,4825,44.25,2
3,0.9188021,4800,4601,6649,43.79,3
4,0.8862479,13500,12709,18541,43.27,4
5,0.8150077,72,65,97,42.08,5
6,0.7851929,360,319,481,41.54,6
7,0.7199837,2700,2291,3541,40.32,7
8,0.6927094,960,799,1249,39.77,8
9,0.6426694,600,481,769,38.72,9
10,0.5861226,6480,4961,8161,37.44,10
11,0.5625,60,45,75,36.87,11
12,0.4894168,2400,1679,2929,34.98,12
13,0.4500174,240,161,289,33.86,13
14,0.4302388,2700,1771,3229,33.26,14
15,0.3871605,90,56,106,31.89,15
16,0.369225019290123,288,175,337,1,16
17,0.299705557698903,864,473,985,1,17
18,0.489416840277778,2400,1679,2929,1,18
19,0.450017361111111,240,161,289,1,19
20,0.430238820301783,2700,1771,3229,1,20
21,0.387160493827161,90,56,106,1,21
22,0.586122566110349,6480,4961,8161,1,22
23,0.000177777777777778,75,1,75,1,23
24,0.489416840277778,2400,1679,2929,1,24
25,0.450017361111111,240,161,289,1,25
26,0.509135720783517,2482,1771,3049,1,26
27,0.111853086419753,900,301,949,1,27
28,0.0927992112482853,1080,329,1129,1,28
29,0.0850694444444444,24,7,25,1,29
30,0.062187890625,1600,399,1649,1,30
31,0.050625,40,9,41,1,31
32,0.0336111111111111,60,11,61,1,32
33,0.0291444964206104,1728,295,1753,1,33
34,0.0139371141975309,144,17,145,1,34
35,0.011141975308642,180,19,181,1,35
36,0.00593470507544582,675,52,677,1,36
37,0.00417100694444444,480,31,481,1,37
38,0.00166736111111111,1200,49,1201,1,38

comma delimited spreadsheet of TEST prime numbers & Plimpton 322

number,fraction_squares,delta**2,long_side,is_prime,short_side,is_prime,diagonal_side,is_prime,side_ratio,acute_angle,complement_angle,line
1,0.9834028,1.9834028,120,FALSE,119,FALSE,169,FALSE,1.00840336134454,44.7602701039192,45.2397298960808,1
2,0.9491586,1.9491586,3456,FALSE,3367,FALSE,4825,FALSE,1.02643302643303,44.2526696187466,45.7473303812534,2
3,0.9188021,1.9188021,4800,FALSE,4601,FALSE,6649,FALSE,1.04325146707238,43.7873462834569,46.2126537165431,3
4,0.8862479,1.8862479,13500,FALSE,12709,FALSE,18541,TRUE,1.06223935793532,43.2713110478808,46.7286889521192,4
5,0.8150077,1.8150077,72,FALSE,65,FALSE,97,TRUE,1.10769230769231,42.0750220508436,47.9249779491564,5
6,0.7851929,1.7851929,360,FALSE,319,FALSE,481,FALSE,1.12852664576803,41.5445093640917,48.4554906359083,6
7,0.7199837,1.7199837,2700,FALSE,2291,FALSE,3541,TRUE,1.17852466171977,40.3152217890896,49.6847782109104,7
8,0.6927094,1.6927094,960,FALSE,799,FALSE,1249,TRUE,1.20150187734668,39.7703302277109,50.2296697722891,8
9,0.6426694,1.6426694,600,FALSE,481,FALSE,769,TRUE,1.24740124740125,38.7179883513894,51.2820116486106,9
10,0.5861226,1.5861226,6480,FALSE,4961,FALSE,8161,TRUE,1.30618826849426,37.4371779573597,52.5628220426403,10
11,0.5625,1.5625,60,FALSE,45,FALSE,75,FALSE,1.33333333333333,36.869897645844,53.130102354156,11
12,0.4894168,1.4894168,2400,FALSE,1679,FALSE,2929,FALSE,1.42942227516379,34.9759947522971,55.0240052477029,12
13,0.4500174,1.4500174,240,FALSE,161,FALSE,289,FALSE,1.49068322981366,33.8550261282941,56.1449738717059,13
14,0.4302388,1.4302388,2700,FALSE,1771,FALSE,3229,TRUE,1.52456239412761,33.2619074134428,56.7380925865572,14
15,0.3871605,1.3871605,90,FALSE,56,FALSE,106,FALSE,1.60714285714286,31.8907918018457,58.1092081981543,15
16,0.369225019290123,1.36922501929012,288,FALSE,175,FALSE,337,TRUE,1.64571428571429,31.2844929144175,58.7155070855825,16
17,0.299705557698903,1.2997055576989,864,FALSE,473,FALSE,985,FALSE,1.82663847780127,28.6986640858943,61.3013359141057,17
18,0.489416840277778,1.48941684027778,2400,FALSE,1679,FALSE,2929,FALSE,1.42942227516379,34.9759947522971,55.0240052477029,18
19,0.450017361111111,1.45001736111111,240,FALSE,161,FALSE,289,FALSE,1.49068322981366,33.8550261282941,56.1449738717059,19
20,0.430238820301783,1.43023882030178,2700,FALSE,1771,FALSE,3229,TRUE,1.52456239412761,33.2619074134428,56.7380925865572,20
21,0.387160493827161,1.38716049382716,90,FALSE,56,FALSE,106,FALSE,1.60714285714286,31.8907918018457,58.1092081981543,21
22,0.586122566110349,1.58612256611035,12,FALSE,5,TRUE,13,TRUE,2.4,22.619,67.381,22
23,0.000177777777777778,1.00017777777778,75,FALSE,871,FALSE,2329,FALSE,0.0861079219288175,21.9613,68.0387,23
24,0.489416840277778,1.48941684027778,2400,FALSE,1679,FALSE,2929,FALSE,1.42942227516379,34.9759947522971,55.0240052477029,24
25,0.450017361111111,1.45001736111111,240,FALSE,161,FALSE,289,FALSE,1.49068322981366,33.8550261282941,56.1449738717059,25
26,0.509135720783517,1.50913572078352,2482,FALSE,1771,FALSE,3049,TRUE,1.40146809712027,35.5100803990245,54.4899196009755,26
27,0.111853086419753,1.11185308641975,900,FALSE,301,FALSE,949,FALSE,2.99003322259136,18.4922254911265,71.5077745088735,27
28,0.0927992112482853,1.09279921124829,1080,FALSE,329,FALSE,1129,TRUE,3.28267477203647,16.9422892660297,73.0577107339703,28
29,0.0850694444444444,1.08506944444444,24,FALSE,7,TRUE,25,FALSE,3.42857142857143,16.260204708312,73.739795291688,29
30,0.062187890625,1.062187890625,1600,FALSE,399,FALSE,1649,FALSE,4.01002506265664,14.0025351149907,75.9974648850093,30
31,0.050625,1.050625,40,FALSE,9,FALSE,41,TRUE,4.44444444444444,12.6803834918198,77.3196165081802,31
32,0.0336111111111111,1.03361111111111,60,FALSE,11,TRUE,61,TRUE,5.45454545454545,10.3888578154696,79.6111421845304,32
33,0.0291444964206104,1.02914449642061,1728,FALSE,295,FALSE,1753,TRUE,5.85762711864407,9.68800075016136,80.3119992498386,33
34,0.0139371141975309,1.01393711419753,144,FALSE,17,TRUE,145,FALSE,8.47058823529412,6.7329213268596,83.2670786731404,34
35,0.011141975308642,1.01114197530864,180,FALSE,19,TRUE,181,TRUE,9.47368421052632,6.02557500836668,83.9744249916333,35
36,0.00593470507544582,1.00593470507545,675,FALSE,52,FALSE,677,TRUE,12.9807692307692,4.40519632353161,85.5948036764684,36
37,0.00417100694444444,1.00417100694444,480,FALSE,31,TRUE,481,FALSE,15.4838709677419,3.69522053198919,86.3047794680108,37
38,0.00166736111111111,1.00166736111111,1200,FALSE,49,FALSE,1201,TRUE,24.4897959183673,2.33827865581484,87.6617213441852,38
,,delta**2-1,,equals,,(l/d)**2,or,(b/d)**2,,,,

What would low number reciprocals of high precision be used for? Late Babylonian tablets (300-400 C.E.) have tables of reciprocal numbers from 1 to 2 evaluated up to 8 powers of 60, (eg. decimal 1.066,1.2,1.25,1.3, and 1.35, not all repeating decimals in base 10 or 60). In decimal notation, the reciprocal pairs would be (1.0666,56.25), (1.2,50) (1.25,48) (1.3, 45)(1.35,44.4444). At least some Babylonian algorithms involve reduction of terms by factorization. Following the factorization task, 45=3*3*5, 48=2*2*2*2*2, 50=2*5*5. I can only suggest some kind of generating function for large squares or logarithms (meaning squares of 8 digits in base 60). The Babylonian square side rule is the sqrt(a) approximates (1/2) * ( target_number / trial_number_reciprocal + 1/ trial_number_reciprocal ). The Babylonian square side rule with a single trial input becomes less accurate with increasing trial_number, much greater than one and above 1000. The converse is probably true; The Babylonian square side rule with a single trial input becomes more accurate with decreasing trial_number, approaching one from above 1000. Ref. The powers of 9 and related mathematical tables from Babylon, Mathieu Ossendrijver (Humboldt University, Berlin)

Note. square side rule, sqrt 4 =~(1/2)* (4 *(1/1)+1), (1/2)*5 or 2.5
                         sqrt 10 =~ (1/2)* (10*(1/3)+3)=
                                      (1./2.)*(10*(1./3.)+3) =3.1666666666666665
                         eval sqrt 10 = 3.1622776601683795

Draft and very unofficial Mission Statement

The mission of the TCL wiki is to provide an open and community-driven venue for documenting and discussing all aspects of the Tool Control Language (TCL), from interpreter, standards, and best practices. Among other things, the TCL Wiki shall collect:

  • Small examples of TCL code.
  • Best practices.
  • Questions and answers regarding TCL code and style.
  • Information and usage examples for various TCL libraries.
  • Comparison of interpreter features and usage.
  • References to books, articles, and other TCL resources on the web.

Download

The full content of the TCL Wiki <not sure about wording here>. The Tool Control Language (TCL) is copyrighted under the Tcl/Tk Licensing Terms to ensure that the content remains free and open.

Hosting

The TCL Wiki is located at http://wiki.tcl.tk/ and is hosted by The Wiki is now hosted by the Tcl Association on behalf of the Tcl Community, and maintained by a team of volunteers. It is powered by a wiki engine written using a network interface and Tcl Database Connectivity

LV : Users have to date adding several kinds of info to this site.

  1. Technical information relating to Tcl and extensions.
  2. Questions (which hopefully are being answered).
  3. Small examples of Tcl code.
  4. Pointers (URLs) to other sites.

If someone has a package, paper, etc. they wish to publicize, this site is best used by pointing to your distribution. If a distribution site for the source code, word processing files, etc. is needed, one might take a look at ftp://ftp.procplace.com/pub/tcl/, http://www.sourceforge.net/, other other similar sites which have facilities for managing source code, bug reports, downloads, etc. This wiki isn't really designed for uploading binary files, or even massive amounts of source code.

End Draft

References:

  • Mission statement, article From Wikipedia,
  • Void Mission statement, article From Wikipedia
  • What is a Mission Statement?,Jennifer Post, Business News Daily Contributing Writer
  • How to Write a Mission Statement in 5 Easy Steps, Tim Berry
  • 50 mission statements selected from the top 100 non-profits
  • Mission statement, Python Software Foundation
  • Mission statement,

math:geometry.
::math::geometry::degToRad angle 
::math::geometry::radToDeg angle

math::geometry(n) 1.2.2 tcllib "Tcl Math Library"
list of proposed 13 trig functions.
sind(x)=Sine of argument in degrees,
 cosd(x)=Cosine of argument in degrees,
 tand(x)=Tangent of argument in degrees, 
cotd(x)=Cotangent of argument in degrees, 
asind(x)=returns the inverse sine (sin-1) of the elements of X in degrees,
 acosd(x)=returns the inverse cosine (cosin-1) of the elements of X in degrees,,
 atand(x)=Inverse tangent in degrees, 
acotd(x)=Inverse cotangent in degrees, 
secd(x)=Secant of argument in degrees,
cscd(x)=Cosecant of argument in degrees,
asecd(x)=Inverse secant in degrees, 
acscd(x)=Inverse cosecant in degrees,
atan2d(x1, x2)=Four-quadrant inverse tangent in degrees
        # pretty print from autoindent and ased editor
        # Sind Functions calculator  
        # written on Windows XP on eTCL
        # working under TCL version 8.5.6 and eTCL 1.0.1
        # gold on TCL WIKI, 5nov2017
        package require Tk
        package require math::numtheory 
        package require math::geometry
        package require math::constants
        namespace path {::tcl::mathop ::tcl::mathfunc math::numtheory math::geometry math::constants}
        set tcl_precision 17
        frame .frame -relief flat -bg aquamarine4
        pack .frame -side top -fill y -anchor center
        set names {{} {degrees :} }
        lappend names {answers: radians:}
        lappend names {cosd function: }
        lappend names {tand function: }
        lappend names {cotd function:}
        lappend names {secd function: }
        lappend names {cscd function: }
        lappend names {sind function:} 
        foreach i {1 2 3 4 5 6 7 8} {
            label .frame.label$i -text [lindex $names $i] -anchor e
            entry .frame.entry$i -width 35 -textvariable side$i
            grid .frame.label$i .frame.entry$i -sticky ew -pady 2 -padx 1 }
        proc about {} {
            set msg "Calculator for Sind Functions
            from TCL WIKI,
            written on eTCL "
            tk_messageBox -title "About" -message $msg } 
       proc ::tcl::mathfunc::precision {precision float}  {
            #  tcl:wiki:Floating-point formatting, [AM]
            set x [ format "%#.5g" $float ]
            return $x
           }   
            #proc errorx always returns a positive error. 
            #Normally assume $aa is human estimate,
            #assume $bb is divinely exact.
       proc errorx  {aa bb} {expr { $aa > $bb ?   (($aa*1.)/$bb -1.)*100. : (($bb*1.)/$aa -1.)*100.}}
         # start sind procedures
       proc division_check {x y} {
         # ref. rossetta code for division by zero
        try {
        if {  [ / $x $y  ]  ==  Inf  } {
        puts " strange Inf value generated " } 
        if {"Inf" == "Inf" || "Inf" == "Inf"} {puts " strange Inf value generated "}
        puts "valid division: $x/$y=[expr {$x/$y}] checkit"
        } trap {ARITH DIVZERO} msg {
        puts "caught division by zero: $x/$y -> $msg"
        } trap {ARITH DOMAIN} msg {
        puts "caught bad division: $x/$y -> $msg"
        } on error msg {
        puts "caught another error: $x/$y -> $msg"
        }
        }     
        # problems if $aa is pi/2 or 90 degs, if $aa is 3*pi/2 or 270 degs
        #if { [ catch {[ $aa ]   } ] == 0 } {
        #return -code error "opps tan 90/270 degs" -errorinfo "undefined for tan 90/270 degs" -errorcode {ARITH 

DOMAIN}
         # ref. rossetta code for division by zero
         proc tangent_check {xx} {
         # ref. rossetta code for division by zero
        try {
        if { $xx  ==  Inf  } {
        puts " strange Inf value generated " } 
        if {$xx == 90. || $xx == 270.} {puts " strange tan value generated "}
#return -code error "opps tan 90/270 degs" -errorinfo "undefined for tan 90/270 degs" -errorcode {ARITH DOMAIN}
        puts "tan opps tan 90/270 degs error called"
        puts "valid tangent? : $xx=90. checkit"
        } trap {ARITH } msg {
        puts "caught bad tangent: $xx -> $msg"
        } trap {ARITH DOMAIN} msg {
        puts "caught bad tangent: $xx -> $msg"
        } on error msg {
        puts "caught another error: $xx -> $msg"
       #return -code error "opps tan 90/270 degs" -errorinfo "undefined for tan 90/270 degs" -errorcode {ARITH 

DOMAIN}
    }
       }
        
    proc cotdx {aa} {set aa [* $aa $math::constants::degtorad ];division_check [cos $aa] [sin $aa ] ; return [/ 

[cos $aa] [sin $aa ]]}
    proc secdx {aa} {set aa [* $aa $math::constants::degtorad ];division_check [1.] [sin $aa ] ;return [/ 1. 

[sin $aa ]]}
    proc cscdx {aa} {set aa [* $aa $math::constants::degtorad ];division_check [1.] [cos $aa ] ; return [/ 1. 

[cos $aa ]]}
    proc acotd {aa} {set aa [/ [acos $aa] [asin $aa ]];set aa [* $aa $math::constants::radtodeg ];return $aa}
    proc asecd {aa} {set aa [/ 1. [asin $aa ]];set aa [* $aa $math::constants::radtodeg ];return $aa}
    proc acscd {aa} {set aa [/ 1. [acos $aa ]];set aa [* $aa $math::constants::radtodeg ];return $aa}
    proc sind {aa} {set aa [* $aa $math::constants::degtorad ];return [sin $aa ]}
    proc cosd {aa} {set aa [* $aa $math::constants::degtorad ];return [cos $aa ]}
    proc tand {aa} {tangent_check $aa ;set aa [* $aa $math::constants::degtorad ];return [tan $aa ]}
    proc cotd {aa} {set aa [* $aa $math::constants::degtorad ];return [cot $aa ]}
    proc secd {aa} {set aa [* $aa $math::constants::degtorad ];return [sec $aa ]}
    proc cscd {aa} {set aa [* $aa $math::constants::degtorad ];return [csc $aa ]}  
    proc asind {aa} {set aa [asin $aa ];set aa [* $aa $math::constants::radtodeg ];return $aa}
    proc acosd {aa} {set aa [acos $aa ];set aa [* $aa $math::constants::radtodeg ];return $aa}
    proc atand {aa} {set aa [atan $aa ];set aa [* $aa $math::constants::radtodeg ];return $aa}
    proc acotd {aa} {set aa [acot $aa ];set aa [* $aa $math::constants::radtodeg ];return $aa}
    proc asecd {aa} {set aa [asec $aa ];set aa [* $aa $math::constants::radtodeg ];return $aa}
    proc acscd {aa} {set aa [acsc $aa ];set aa [* $aa $math::constants::radtodeg ];return $aa}
        proc pade_asind_good {aa} {
        set term2 [ expr {  $aa*$aa*$aa*$aa*$aa*61.+1080.*$aa*$aa*$aa-2520.*$aa  } ] ;
        set term3 [ expr {  1500.*$aa*$aa-2520.  } ] ;
        set result  [ expr {  $term2/$term3 } ]
        set aa [* $aa $math::constants::radtodeg ];}   
        proc pade_acosd_check_it {aa} {
        set term2 [ expr {  12. - 5.*$aa*$aa } ] ;
        set term3 [ expr {  12. + $aa*$aa  } ] ;
        set result  [ expr {  $term2/$term3 } ]
        set aa [* $aa $math::constants::radtodeg ];}         
        proc pade_cosd_g {aa} {
        set aa [* $aa $math::constants::degtorad ];
        set term2 [ expr {  1080.-480.*$aa*$aa+$aa*$aa*$aa*$aa*17. } ] ;
        set term3 [ expr {  1080.+60.*$aa*$aa+2.*$aa*$aa*$aa*$aa} ] ;
        set result  [ expr {  $term2/$term3 } ]} 
        proc pade_tand_gtest {aa} { 
        set aa [* $aa $math::constants::degtorad ];
        set term2 [ expr {  15.*$aa-$aa*$aa*$aa } ] ;
        set term3 [ expr {  15.-6.*$aa*$aa} ] ;
        set result  [ expr {  $term2/$term3 } ]} 
        proc pade_cottand_gtest {aa} {
        set aa [* $aa $math::constants::degtorad ];
        set term2 [ expr {  15.*$aa-$aa*$aa*$aa } ] ;
        set term3 [ expr {  15.-6.*$aa*$aa} ] ;
        set result  [ expr {  $term3/$term2 } ]} 
        proc pade_cscd_g {aa} {
        set aa [* $aa $math::constants::degtorad ];
        set term2 [ expr {  1080.-480.*$aa*$aa+$aa*$aa*$aa*$aa*17. } ] ;
        set term3 [ expr {  1080.+60.*$aa*$aa+2.*$aa*$aa*$aa*$aa} ] ;
        set result  [ expr {  $term3/$term2 } ]} 
        proc pade_secd_g {aa} {
        set aa [* $aa $math::constants::degtorad ];
        set term2 [ expr {  1080.-480.*$aa*$aa+$aa*$aa*$aa*$aa*17. } ] ;
        set term3 [ expr {  1080.+60.*$aa*$aa+2.*$aa*$aa*$aa*$aa} ] ;
        set result  [ expr {  $term3/$term2 } ] }    
        proc pade_acscd_check {aa} {
        set term2 [ expr {  $aa*$aa*$aa*$aa*$aa*61.+1080.*$aa*$aa*$aa-2520.*$aa  } ] ;
        set term3 [ expr {  1500.*$aa*$aa-2520.  } ] ;
        set result  [ expr {  $term3/$term2 } ]
        set aa [* $aa $math::constants::radtodeg ];}
        proc pade_atand_good {aa} {
        set term2 [ expr {  $aa*$aa*$aa*55.+105.*$aa  } ] ;
        set term3 [ expr {  $aa*$aa*$aa*$aa*9.+$aa*$aa*90.+105.  } ] ;
        set result  [ expr {  $term2/$term3 } ]
        set aa [* $aa $math::constants::radtodeg ];}
        proc pade_acotd_check {aa} {
        set term2 [ expr {  $aa*$aa*$aa*55.+105.*$aa  } ] ;
        set term3 [ expr {  $aa*$aa*$aa*$aa*9.+$aa*$aa*90.+105.  } ] ;
        set result  [ expr {  $term3/$term2 } ]
        set aa [* $aa $math::constants::radtodeg ];}
        proc pade_acscd_check {aa} {
        set term2 [ expr {  $aa*$aa*$aa*$aa*$aa*61.+1080.*$aa*$aa*$aa-2520.*$aa  } ] ;
        set term3 [ expr {  1500.*$aa*$aa-2520.  } ] ;
        set result  [ expr {  $term3/$term2 } ]
        set aa [* $aa $math::constants::radtodeg ];}
        proc pade_atand_good {aa} {
        set term2 [ expr {  $aa*$aa*$aa*55.+105.*$aa  } ] ;
        set term3 [ expr {  $aa*$aa*$aa*$aa*9.+$aa*$aa*90.+105.  } ] ;
        set result  [ expr {  $term2/$term3 } ]
        set aa [* $aa $math::constants::radtodeg ];}        
        # end sind procedures
       proc calculate {     } {
            global answer2
            global side1 side2 side3 side4 side5
            global side6 side7 side8 
            global testcase_number
            incr testcase_number 
            set side1 [* $side1 1. ]
            set side2 [* $side2 1. ]
            set side3 [* $side3 1. ]
            set side4 [* $side4 1. ]
            set side5 [* $side5 1. ]
            set side6 [* $side6 1. ]
            set side7 [* $side7 1. ]
            set side8 [* $side8 1. ]
            set side2 [* $side1  $math::constants::degtorad ]
            set side3 [ pade_cosd_g $side1  ]
            set side4 [ pade_tand_gtest $side1  ]
            #set side5 [ cotdx $side1 ]
            #set side6 [ secdx $side1 ]
            #set side7 [ cscdx $side1 ] 
            set side8 [ sind $side1 ] 
          catch { set side5 [ pade_cottand_gtest $side1 ]       }
          catch { set side6 [ pade_secd_g $side1 ]       }
          catch { set side7 [ pade_cscd_g $side1 ]     }  
                    }
        proc fillup {aa bb cc dd ee ff gg hh} {
            .frame.entry1 insert 0 "$aa"
            .frame.entry2 insert 0 "$bb"
            .frame.entry3 insert 0 "$cc"
            .frame.entry4 insert 0 "$dd"
            .frame.entry5 insert 0 "$ee"
            .frame.entry6 insert 0 "$ff" 
            .frame.entry7 insert 0 "$gg"
            .frame.entry8 insert 0 "$hh" 
             }
        proc clearx {} {
            foreach i {1 2 3 4 5 6 7 8 } {
                .frame.entry$i delete 0 end } }
        proc reportx {} {
            global answer2
            global side1 side2 side3 side4 side5
            global side6 side7 side8
            global testcase_number
            console show;
            puts "%|table $testcase_number|printed in| tcl wiki format|% "
            puts "&| quantity| value| comment, if any|& "
            puts "&| $testcase_number:|testcase_number | |&"
            puts "&| $side1 :|degrees |   |&"
            puts "&| $side2 :|answers : conv. radians, used in arc functions | |& "  
            puts "&| $side3 :|cosd function| |& "
            puts "&| $side4 :|tand function| |&"
            puts "&| $side5 :|cotd function | |&"
            puts "&| $side6 :|secd function |  |&"
            puts "&| $side7 :|cscd function |  |&"
            puts "&| $side8 :|sind function |  |&" 
            puts "&|[ pade_asind_good $side2 ] :|asind function |  |&" 
            puts "&| [ pade_acosd_check_it $side2 ] :|acosd function |  |&" 
            puts "&|[ pade_atand_good $side2 ]:|atand function |  |&" 
            puts "&|[ pade_acotd_check $side2 ]:|acotd function |  |&" 
            puts "&|[ pade_secd_g $side2 ]:|asecd function |  |&"
            puts "&| [ pade_acscd_check $side2 ] :|acscd function |  |&" 
            math::constants::print-constants
            puts " $math::constants::radtodeg "
            puts " $math::constants::degtorad "
             # math::geometry::print-geometry 
            }
        frame .buttons -bg aquamarine4
        ::ttk::button .calculator -text "Solve" -command { set side8 0 ; calculate   }
        ::ttk::button .test2 -text "Testcase1" -command {clearx;fillup 0.0  0.0  0.1 1.0  0.0   0.0    0.00  

0.0}
        ::ttk::button .test3 -text "Testcase2" -command {clearx;fillup 180.0 3.14 -1. 0.0   0.0   0.0  0.00     

1.0}
        ::ttk::button .test4 -text "Testcase3" -command {clearx;fillup 360.0 6.28 1.0  0.0  0.0    -1.0  

10000.00  0.001}
        ::ttk::button .clearallx -text clear -command {clearx }
        ::ttk::button .about -text about -command {about}
        ::ttk::button .cons -text report -command { reportx }
        ::ttk::button .exit -text exit -command {exit}
        pack .calculator  -in .buttons -side top -padx 10 -pady 5
        pack  .clearallx .cons .about .exit .test4 .test3 .test2   -side bottom -in .buttons
        grid .frame .buttons -sticky ns -pady {0 10}
               . configure -background aquamarine4 -highlightcolor brown -relief raised -border 30
        wm title . "Sind Functions Calculator"     

    using psuedocode to set up problem
    angle a  in radians. Multiply by pi/180 to convert degrees to radians.
    starting sind procedure
    a in radians
    package require math::constants
    radtodeg = 57.295779513100001 = Conversion from radians to degrees
    degtorad = 0.017453292519943001 = Conversion from degrees to radians
    set con5 $math::constants::degtorad
    set con6 $math::constants::radtodeg
    invoke 0.017453292519943001
    set a [* $a (3.14/180) ] , 3.14/180~0.01744
    set a [sin  $a  ]
    return $a
    proc sind {aa} {set aa [* $aa $math::constants::degtorad ];return [sin $aa ]}
    starting asind procedure
    take asin and return answer in degrees , changing
    set a [asin  $a  ]
    set a [* $a (180/3.14) ] , 180/3.14~57.32
    proc asind {aa} {set aa [asin $aa ];set aa [* $aa $math::constants::radtodeg ];return $aa}

    proc degree_reduction {aa} {
    if { $aa > 0 } {
    while {$aa > 360.} {
    set aa [- $aa 360.}
    return $aa }
    if { $aa < 0 } {
    while {$aa < 360.} {
    set aa [+ $aa 360.}
    return $aa }}

Alternate subroutines under test

        # written on Windows XP
        # working under TCL version 8.5.6 and eTCL 1.0.1
        # gold on TCL WIKI, 25nov2017
        package require Tk
        package require math::numtheory
        package require math::geometry
        package require math::constants
        namespace path {::tcl::mathop ::tcl::mathfunc math::numtheory math::geometry math::constants}
        set tcl_precision 17
        # need TCLLIB invoke
    # start sind procedures
    proc sind {aa} {set aa [* $aa $math::constants::degtorad ];return [sin $aa ]}
    proc cosd {aa} {set aa [* $aa $math::constants::degtorad ];return [cos $aa ]}
    proc tand {aa} {set aa [* $aa $math::constants::degtorad ];return [tan $aa ]}
    proc cotd {aa} {set aa [* $aa $math::constants::degtorad ];return [cot $aa ]}
    proc secd {aa} {set aa [* $aa $math::constants::degtorad ];return [sec $aa ]}
    proc cscd {aa} {set aa [* $aa $math::constants::degtorad ];return [csc $aa ]}
    proc asind {aa} {set aa [asin $aa ];set aa [* $aa $math::constants::radtodeg ];return $aa}
    proc acosd {aa} {set aa [acos $aa ];set aa [* $aa $math::constants::radtodeg ];return $aa}
    proc atand {aa} {set aa [atan $aa ];set aa [* $aa $math::constants::radtodeg ];return $aa}
    proc acotd {aa} {set aa [acot $aa ];set aa [* $aa $math::constants::radtodeg ];return $aa}
    proc asecd {aa} {set aa [asec $aa ];set aa [* $aa $math::constants::radtodeg ];return $aa}
    proc acscd {aa} {set aa [acsc $aa ];set aa [* $aa $math::constants::radtodeg ];return $aa}
        # end sind procedures
        # note: may have to invoke cot, sec, csc from some other library
        # extrafuncs.tcl

        # pade_trig functions
        # need angle reduction proc to pi/4
        # start higher order terms
        proc pade_asind_good {aa} {
        set term2 [ expr {  $aa*$aa*$aa*$aa*$aa*61.+1080.*$aa*$aa*$aa-2520.*$aa  } ] ;
        set term3 [ expr {  1500.*$aa*$aa-2520.  } ] ;
        set result  [ expr {  $term2/$term3 } ]
        set aa [* $aa $math::constants::radtodeg ];}
        proc pade_cosd_g {aa} {
        set aa [* $aa $math::constants::degtorad ];
        set term2 [ expr {  1080.-480.*$aa*$aa+$aa*$aa*$aa*$aa*17. } ] ;
        set term3 [ expr {  1080.+60.*$aa*$aa+2.*$aa*$aa*$aa*$aa} ] ;
        set result  [ expr {  $term2/$term3 } ]}
        proc pade_secd_g {aa} {
        set aa [* $aa $math::constants::degtorad ];
        set term2 [ expr {  1080.-480.*$aa*$aa+$aa*$aa*$aa*$aa*17. } ] ;
        set term3 [ expr {  1080.+60.*$aa*$aa+2.*$aa*$aa*$aa*$aa} ] ;
        set result  [ expr {  $term3/$term2 } ] }
        proc pade_acscd_check {aa} {
        set term2 [ expr {  $aa*$aa*$aa*$aa*$aa*61.+1080.*$aa*$aa*$aa-2520.*$aa  } ] ;
        set term3 [ expr {  1500.*$aa*$aa-2520.  } ] ;
        set result  [ expr {  $term3/$term2 } ]
        set aa [* $aa $math::constants::radtodeg ];}
        proc pade_atand_good {aa} {
        set term2 [ expr {  $aa*$aa*$aa*55.+105.*$aa  } ] ;
        set term3 [ expr {  $aa*$aa*$aa*$aa*9.+$aa*$aa*90.+105.  } ] ;
        set result  [ expr {  $term2/$term3 } ]
        set aa [* $aa $math::constants::radtodeg ];}
        proc pade_acotd_check {aa} {
        set term2 [ expr {  $aa*$aa*$aa*55.+105.*$aa  } ] ;
        set term3 [ expr {  $aa*$aa*$aa*$aa*9.+$aa*$aa*90.+105.  } ] ;
        set result  [ expr {  $term3/$term2 } ]
        set aa [* $aa $math::constants::radtodeg ];} proc pade_acscd_check {aa} {
        set term2 [ expr {  $aa*$aa*$aa*$aa*$aa*61.+1080.*$aa*$aa*$aa-2520.*$aa  } ] ;
        set term3 [ expr {  1500.*$aa*$aa-2520.  } ] ;
        set result  [ expr {  $term3/$term2 } ]
        set aa [* $aa $math::constants::radtodeg ];}
        proc pade_atand_good {aa} {
        set term2 [ expr {  $aa*$aa*$aa*55.+105.*$aa  } ] ;
        set term3 [ expr {  $aa*$aa*$aa*$aa*9.+$aa*$aa*90.+105.  } ] ;
        set result  [ expr {  $term2/$term3 } ]
        set aa [* $aa $math::constants::radtodeg ];}
        proc pade_acotd_check {aa} {
        set term2 [ expr {  $aa*$aa*$aa*55.+105.*$aa  } ] ;
        set term3 [ expr {  $aa*$aa*$aa*$aa*9.+$aa*$aa*90.+105.  } ] ;
        set result  [ expr {  $term3/$term2 } ]
        # end higher order terms
        # start lower order terms
        proc pade_cosd {aa} {
        set aa [* $aa $math::constants::degtorad ];
        set term2 [ expr {  $aa*$aa*(60.+3.*$aa*$aa)  } ] ;
        set term3 [ expr {  120.+4.*$aa*$aa  } ] ;
        set result  [ expr {  1. - $term2/$term3 } ] }
        proc pade_atand {aa} {
        set term2 [ expr {  $aa*$aa*$aa*(35.+4.*$aa*$aa)  } ] ;
        set term3 [ expr {  105.+75.*$aa*$aa  } ] ;
        set result  [ expr {  $aa - $term2/$term3 } ]
        set result [* $result $math::constants::radtodeg ];
        }
        set aa [* $aa $math::constants::radtodeg ];}
        proc pade_cosd {aa} {
        set aa [* $aa $math::constants::degtorad ];
        return [- 1. [* [* $aa $aa ] [/ [+ 60. [* 3. $aa  $aa ] [+ 120. [* 4. $aa  $aa  ]]]}
        proc pade_tand {aa} {
        set aa [* $aa $math::constants::degtorad ];
        return [- $aa [* [* $aa $aa $aa ] [/ [- 210. [* $aa  $aa ] [- 630. [* 255. $aa  $aa  ]]]}
        proc pade_asind {aa} {
        set aa [* $aa $math::constants::degtorad ];
        return [* $aa  [/ [- 60. [* 17. $aa  $aa ] [- 60. [* 27. $aa  $aa  ]]]}
        proc pade_tand {aa} {
        set aa [* $aa $math::constants::degtorad ];
        return [- $aa [/ [* [* $aa $aa $aa ] [+ 35. [* 4. $aa  $aa ]] [+ 105. [* 75. $aa  $aa  ]]]]}
        proc pade_sind {aa} {
        set aa [* $aa $math::constants::degtorad ];
        #return [- $aa [/ [* [* $aa $aa $aa ] [+ 420. [* 11. $aa  $aa ] [+ 2520. [* 60. $aa  $aa  ]]]}
        proc pade_sind_expr {aa} {
        set aa [* $aa $math::constants::degtorad ];
        set term2 [ expr { $aa*$aa*$aa*(420.+11.*$aa*$aa) } ]
        set term3 [ expr { 2520. + 60.*$aa*$aa } ]
        set result [ expr { $aa - $term2/$term3 } ]
        return $result
        # something wrong in expression, lower order terms?
        }
        # end lower order terms
        # Pade test on e**x
        # ## Pade approximant for e**x of order [5 / 5], starts at x**0 around x=0
        # $Px = [1] 1.000000e+00 5.000000e-01 1.111111e-01 1.388889e-02 9.920635e-04 [6] 3.306878e-05
        # $Qx [1]  1.000000e+00 -5.000000e-01  1.111111e-01 -1.388889e-02  9.920635e-04[6] -3.306878e-05
        # note. coeff's have same magnitude but some different signs.
        proc pade_e**x_check {aa} {
        set term2 [ expr {1.000000e+00*[** $aa 0 ] +5.000000e-01*[** $aa 1 ] +1.111111e-01*[** $aa 2 ] +1.388889e-02*[** $aa 3 ] +9.920635e-04*[** $aa 4 ] +3.306878e-05*[** $aa 5 ] } ] ;
        set term3 [ expr {1.000000e+00*[** $aa 0 ] -5.000000e-01*[** $aa 1 ]  -1.111111e-01*[** $aa 2 ] -1.388889e-02*[** $aa 3 ]   +9.920635e-04*[** $aa 4 ] -3.306878e-05*[** $aa 5 ]} ] ;
        set result  [ expr {  $term2/$term3 } ]
        return $result;}
        #  e**1 from approximant formula = 2.718281828735696, ac 9 places.
        # vis wolfram=e=2.718281828459045235360287471352662497757...
        proc ln_1_plus_x {x} {
        # pade expression for ln(1+x)
        # natural log of 1+x, eg.  ln 1+1 (2)  tcl_evaled as 0.6931471805599453
        # ln_1_plus_x 1 reported 0.693121693121693, acc. 4 places
        set term2 [ expr { $x + $x**2 + 0.1833333333333333*($x**3)} ] ;
        set term3 [ expr { 1 + 1.5*$x + .6*($x**2) + 0.05*($x**3)  } ] ;
        set result  [ expr {  $term2 / $term3 } ]
        return $result;}

Historical interest. This formula was the basis of sine tables of the Indian mathematician Bhaskara 1 in the seventh century. Believed that formula was derived from parabolic curve. for positive x < pi. Bhaskara used integers in the seventh century, but post on Math Exchange suggested constants could be gamed or normalized to fit sine curve better. Often wondered whether the parabolic curve could be fudged into a sine or cosine curve.

gold This page is copyrighted under the TCL/TK license terms, this license.