This page is under development. Comments are welcome, but please load any comments in the comments section at the bottom of the page. Please include your wiki MONIKER and date in your comment with the same courtesy that I will give you. Aside from your courtesy, your wiki MONIKER and date as a signature and minimal good faith of any internet post are the rules of this TCL-WIKI. Its very hard to reply reasonably without some background of the correspondent on his WIKI bio page. Thanks, gold 12Dec2018

- Babylonian Shadow Lengths & Angles and eTCL Slot Calculator Demo Example
- Introduction
- Gradient Coefficients
- Shadow Lengths
- Calculator Use
- Appendix Code
- Output from console
- Comments Section

gold Here are some TCL calculations on gradient and tangent angles from the Old Babylonian coefficient tables. The impetus for these calculations was the gnomon instructions tablets. Most of the testcases involve replicas or models, using assumptions and rules of thumb.

In the cuneiform math problems and coefficient lists on clay tablets, there are coefficient numbers which were used in determining the amount of materials and the daily work rates of the workers. In most cases, the math problem is how the coefficient was used in estimating materials, work rates, and math problems. One difficulty is determining the effective magnitude or power of the number coefficient in the base 60 notation. In cuneiform, numbers in base 60 are written using a relative notation. For example, 20 could represent either 20*3600,20,20/60, 20/3600, or even 1/20. The basic dimensions and final tallies were presented in the cuneiform accounts on clay tablets, but some calculations, some units, and some problem answers (aw shucks!) were left off the tablet. Successive or iterated math solutions are called algorithms and the Babylonian methods are some of the earliest algorithms documented circa 1600 BCE. The TCL procedures are descendants of this idea. The Babylonians did not use algebra notation, decimal notation, or modern units, so the reader will have to bear some anachronisms in the TCL code. At least one approach for the modern reader and using modern terminology is to develop the implied algebraic equations and decimal equivalents from the cuneiform numbers. Then the TCL calculator can be run over a number of testcases to validate the algebraic equations.

The eTCL calculator is estimating the gradient and tangent angles from integer ratios, especially those from the coefficient tables, Babylonian shadow length tables (Mul Apin), and gnomon instructions tablets. In pseudocode, each angle is $kay*atan($N1/$N2), where N1&N2 are integers and N1 > N2. Some analysts believe the Babylonian gnomon was 1 cubit high ( 0.5 meter ) in the Mul Apin, but the length of the gnomon is not explicitly stated or obvious in the available texts. As an intermediate step, the eTCL calculator can be used to calculate a table of tangent angles.

In the Old Babylonian coefficient tables, the 7 readable gradients in a set are 1/7, 1/6, 1/5, 1/4, 1/3, 1/2, and 2/3. There are unreadable lines before and after the set of readable gradients. On the same tablet, there are readable lines that have 1/1 sides for a square. In other texts, there is a math problem that calls for a 1 cubit vertical decline in a cubit horizontal distance (1/1), equivalent to a tangent angle of 45 degrees. So its probably safe to add the 1/1 ratio at equivalent 45 degrees to the table of standard gradients

There are several tablets that deal with the predictions for the length of the gnomon shadow over the day, including the Mul Apin and the gnomon instructions tablets. For the lunar eclipse predictions, the Babylonian astronomers reported the eclipses or potential eclipses as time periods after sunrise or time periods before sunset. The duration of day or the day1/day2 ratio could be used in a corrective factor as <main eclipse prediction> + kay*<corrective factor>. From the Mul Apin, the corrective ratio 1:2 was used for shortest day over longest day for the year (near Babylon). Another corrective ratio 2:3 has been found in later LB texts. Using the day/night ratios, the Babylonian astronomers developed a piecewise solution to a nonlinear problem. Although not completely understood, some elements of the gnomon instructions tablets appear to be parallel texts and followup on the day/night duration predictions and the eclipse correction factor.

In the gnomon instructions tablets, there are a number of terms that need resolution. There is handuhhu of the Cancer (month 4) and handuhhu of the Capricorn (month 10). In other contexts, handuhhu has meant lock part or rooster spur. Also, handuhhu same was used for the boundary? pin? of the heavens. The LB. handuhhu shares root words with Su. he-nun (plenty), Su. he-en-du (path), Su. hen-zer (bronze pin),he-pe (multiply by fraction (1/2?)) and Akk. he-gal (point? great). In astrology terms, arrow, Su. kak-si-di, or Su. gag.si.sa was used to designate month 5 (or star Sirius). Its possible that handuhhu refers either to the border of month 4 or the gnomon setup for summer solstice and winter solstice. In later astronomy definitions, the constellation Cancer or month 4 extended 30 degrees, and if the center of Cancer is the center of the gnomon shadow chart, the bounds of Cancer might extend plus or minus 15 degrees of center.

Let us look at cuneiform terms for shadow and possible etymology in the gnomon instructions texts. The LB. word translated as shadow ( nis-mi ) already carries the connotation of tool. The Sumerian verb was nissu...lal (shadow ... reach or extend). The Su. nissu was a compound word written as nis-mi ( nis=tool, mi=substitute). Another variant word for shadow was Su. gissu or Akk. sillu. The phrase "gissu-bi" ( its shadow ) is found in the Sumerian literature.

The gnomon instructions tablets are partly broken and the late Babylonian terminology is so different from the other OB. astronomy and math texts, it is difficult to follow the internal narrative. One approach is study the initial instructions on setting the gnomon up and the final chart construction for shadow lengths, up to the broken off portion. If the bounds or limits of the final chart can be determined from modern calculations, then perhaps the internal narrative will make more sense. The initial instructions are to brick up on the left and right of the na (stone gnomon?) which suggested building a temporary support. For the final chart construction, the "2 kus sag" suggests drawing on a wooden board 2 cubits on a side. From the shadow predictions in the Mul Apin, the Babylonian astronomers appear to be concentrating on measuring the midmorning shadow and the noon shadow in cubits.

Astrology theory for gnomon setup: In the early cuneiform and Sanskrit literature, the sun at the spring and fall equinox was considered to rest in his house for 15 days. Alternately the sun was considered to cross over to the northern or southern path at the equinox. The altar and temple buildings were designed with gnomon circles with a east-west line (meaning diagram crossbar). In Sumeria, stone dedication steles (narua) were buried in the foundations of some temples. The narua (stone erect/planted) were bent cones, which looked somewhat like a oxen horn with the length of a small man (~ 1.2 meters). One version of the narua was written as na-kak in cuneiform, stone arrow or stone wedge. It was believed that power of the sun would rest with the narua in the foundations. The shape of the narua was a good candidate for a gnomon. Maybe false cognates, but the early Sanskrit literature has a gnomon type called a nara (man stone). Perhaps the setup of the chart is analogous to setting up an East-West line of a building foundation. In the midst of the corrupted text beginnings, the number ...4... is discernible. Perhaps ...4... is setting the four directions with the gnomon after an invocation to Bel.

In modern terms, the shadow lengths and time slice of the morning study would be limited by the dimensions of the "2 kus sag" chart. The midmorning shadow would at tangent angle of atan (assumed gmonon/shadow), atan (1 cubit/1 cubit), atan (1/1), 45 degrees. The understanding is that the texts define midmorning by a constant shadow length of 1 cubit, not using time. The time (after sunrise) that the sun reaches the midmorning locus varies throughout the year. At Babylon, the noon shadow from a 1 cubit gnomon varies from 9/60 to 88/60 cubits over the year. The tangent angle at noon would range from atan(1/(9/60)) to atan (1/(88/60)) , 48 to 33.86 degrees in modern terms. Assuming full scale drawing on the shadows, the 2 kus on a side would limit the "2 kus sag" chart to a certain window of shadow sizes and tangent angles. The tangent angles in the 2 kus window would be limited to atan(1/2), above 26.5 degrees. An alternate possibility is to subtract 1 cubit from the "morning lengths", which some of the gnomon instructions imply, and the resultant limit would be atan(1/(1+2), atan(1/3), above 18.4 degrees.

Using the modern formulas, some trial calculations for the shadow lengths at noon can be made with the hand calculator. These will not have the accuracy of the large computer programs, but can provide some rounded peg points for the shadow charts for a gnomon of 1 cubit length. Babylon was at 33/13/59N, decimal degrees 32.3305N and 44/22/00E, decimal degrees 44.3666E. The axial tilt or obliquity is 23.44 at present; the tilt in Babylonian times was about 23.75 degrees (500 BCE). The noon shadow of the winter solstice (B. month 10) was 1 cubit * tan(32.3305-23.75), 1*tan(8.5805), rounded decimal 0.15 cubits, or 9/60 cubits. The noon shadow of the spring equinox (B. month 1 ) and fall equinox (B. month 7 ) was 1 cubit * tan(32.3305), rounded decimal 0.6329 cubits, or 38/60 cubits. The noon shadow of the summer solstice (B. month 4 ) was 1 cubit * tan(32.3305+23.75), 1*tan(56.0805), rounded decimal 1.487 cubits, or 89/60 cubits.

In reference to shadow lengths in the Mul Apin and the gnomon instructions texts, there is uncertaincy in the obliquity partly from the modeling of the obliquity and partly in that most tablets are undated. Where the tablet date or measurement date is uncertain, the obliquity can not be modeled beyond a certain point. An error of 1-(23.44/23.75) or rounding 2 percent could be attributed to obliquity modeling. Also the Babylonians usually measured a quantity to 1) fractions of the nearest 1/60 and 2) fractions regular in base 60, which introduced a quantization error. For example, rounding odd 37/60 cubits to even and regular 38/60 cubits would have an error of 1-(37/60)/(38/60) or rounding 3 percent error.

Possibly the chart is whitewashed wooden square with side of 2 cubits. A tablet or brick of this size would weight more than 60 kg. Also, some of the instructions such as drawing in red and draw lightly suggest brush ink, but the cuneiform words would have to be carefully studied on this issue. Each side is 2 cubits divided into 12 intervals. 2 cubits = 60 fingers and each tick is 60/12 or 5 fingers. The "front stylus" marks used in measurements are the ticks of five fingers. On the square board, a circle is inscribed with a diameter of 2 cubits and the gnomon placed at center. The inscribed circle has 3 (Babylonian pi) times diameter, 3*12, 36 ticks. Each tick is 360/36 or ten degrees each. While the gnomon chart is laid horizontal for solar daylight use, possibly the system for observation of 36 zenith stars may come into play. Babylonian astronomers were instructed to view the heavens facing South and directions fall out from that stance. Directions on the chart are South=front, East = left, North=back, and West=right.

The terms "maqtu=fallen" or "uskarum=crescent stone?" from Su. u-sakar has root words meaning fallen or hollow and may refer the curve of the gnomon shadow length growing shorter as noon approaches and then getting longer in the afternoon. The crossbar is the midmorning point of one cubit shadow, which generally was used to develop an East-West line on the gnomon circle or chart. The transversal on the chart is where shadows turn, meaning spring equinox. On the chart, the length of the shadow of spring equinox is used to set transversal, measuring from the gnomon at the center of the chart. At Babylon by coincidence, the shadow of the spring equinox is near 2/3 cubit and the shadow of the summer solstice is near 3/2. The midmorning shadow of 1 cubit length places the sun at tangent (1/1) or 45 degrees. The time of the midmorning shadow is roughly 1/4 of the total daylight time and the time of the afternoon shadow is roughly 3/4 of total daylight. At the spring equinox, such a chart span could measure 12 hours *(3/4-1/4),12*2/4, roughly 6 hours with noon at center.

On the gnomon instructions for the chart(s), shadows appear to be measured in respect to reference lengths, the crossbar and the transversal. Quotations from the translation by Mathieu Ossendrijver: > "The shadows above the transversal you measure", meaning shadow subtract 1/2 cubit. "Shadows beyond 1/4 of crossbar you draw in red.", equivalent to shadow-(1/4)*crossbar. "... the mar-tu (ma-tu?) written down...", possibly mar-tu or ma-tu means delay.Under other names, delay is sometimes used for the eastward motion of heavenly bodies. Alternate text has " shadows beyond 1/2 of the crossbar you measure. ", equivalent to shadow-(1/2)*crossbar. < With the gnomon at the center of 2*2 cubit board, shadows at full scale could only be measured as far as the corners or sqrt(1**2+1**2), sqrt(2), 1.414, rounded 1.4 meters. Alternate possibilities are to multiply the shadows by some fraction (rescale measurements) or to subtract some amount from measured shadows to fit on board. The most likely alternate possibility is to subtract 1 cubit from the "morning lengths", which some of the gnomon instructions imply.

These shadow subtraction schemes probably refer to different terms or charts, but some terms may be convertible among themselves. Converting to modern algebraic expressions, the terms are shadow-(1/4)*crossbar, shadow-(1/2)*crossbar, shadow above transversal-(1/2)*cubit, and shadow-(1)*cubit. The terms of shadow-fraction*crossbar may represent a general solution, suitable to different areas. The terms of shadow-fraction*crossbar can be converted with the crossbar as 1 cubit as terms shadow-(1/4)*(1) cubit and shadow-(1/2)*(1) cubit. The terms of shadow-fraction*cubit represent a particular solution, unique to the shadow values of Babylon. The transversal shadow was 0.6733 or rounded 2/3 cubits at Babylon, and substituting, shadows -2/3 - (1/2)cubit gives shadows - 1.16 cubits. The term shadows - 1.16 cubits is very close to shadows-1 cubit in terms of a gnomon of uncertain base width and rounding to integral cubit shadows.

The research is looking for hints on the gnomon and the horizontal diagram or dial discussed in the Hindu astronomy and Surya Siddhanta. In Early Indian Astronomy by George Abraham, the term (shadow minus noon shadow) is used in a Hindu formula for daylight length as d/(2*t)=( (S-S0)/g )+1, where g is gnomon length, S is shadow length,S0 is shadow length at noon, and t/d is fraction of time from sunrise over the total daylight time. In the Indian Sanskrit literature, the shadow on the horizontal dial is called the bhuj or earth and forms a right triangle with the upright gnomon (nara yantra (man instrument) or sandu (stake)). The hypotenuse would be from the upper tip of the gnomon to the end of the shadow. The angle on the horizontal chart between North and the shadow is the azimuth of the sun from North, referring to the Babylonian gnomon alignment in the Northern hemisphere. The angle on the horizontal dial between the East to West line and the shadow on the dial is translated as "amplitude of the sun" (agra). The total shadow or parts of the shadow (subtracting the equinox shadow, antya) are translated as the rsine (radius*sine) of the solar amplitude (agra jya). Agra is derived from a root word meaning field.

The factors 1/4 and 1/2 have been seen before in Babylonian time of shadow calculations. In Shadow-Length Schemes by Dr. Steele, 1/4 and 1/2 were factors used to calculate daily changes in the time after sunrise to the midmorning shadow and noon shadow of the gnomons. The Babylonians measured these changes in "us" units (4 minutes each on a water clock) . In a simplified form, the first equation would be daily change in daylight period in "us" units times 1/4 equals daily change in time from sunrise to midmorning. The second equation would be daily change in daylight period in us units times 1/2 equals daily change in time from sunrise to noon. Not sure about the validity in astronomy, but the measurement system in the texts transfers proportions in time (from the Mul Apin) to proportions in gnomon shadow length. The shadow function(1/4) equals daily shadow change at midmorning (1 cubit shadow) and shadow function(1/2) equals daily shadow change at noon. The functions for time after sunrise and shadow length are attempting to model nonlinear quantities with a constant rate or proportions. In terms of the math available to the Babylonians, a long table for every day or month of the year would probably be more effective.

For the eTCL calculator, the length of any gnomon is set as the master length in centimeters. Using proportions, the gnomon length is multiplied by the reciprocal shadow ratio at Babylon and gives the calculated shadow length. For example, loading gnomon length of 100 centimeters and ratio (1/2) gives shadow length 100*(1/(1/2)), 100*2, or 200 c. The units are passed through unchanged, so the gnomon master length could be in inches or feet with the same units returned on the shadow.

area = [* length width ] # square meters

Month | Constellation | minutes | decimal minas | |
---|---|---|---|---|

1 | Aries | 720 | 3 | |

2 | Taurus | 800 | 3.3 | |

3 | Gemini | 848 | 3.53 | |

4 | Cancer | 864 | 3.6 | |

5 | Leo | 848 | 3.53 | |

6 | Virgo | 800 | 3.33 | |

7 | Libra | 720 | 3 | |

8 | Scorpius | 640 | 2.66 | |

9 | Sagittarius | 592 | 2.46 | |

10 | Capricorn | 576 | 2.4 | |

11 | Aquarius | 592 | 2.46 | |

12 | Pisces | 640 | 2.66 | |

converted data from Neugebauer 1975, pg. 370) |

hand calculator | formula | months in | Babylonian order | ||
---|---|---|---|---|---|

shadow length cubits | decimal cubits | days lunar year | B. month | constellation=month | comment |

38/60 | 0.6733 | 10 | 1 | Aries | spring equinox, midpoint shadow |

89/60 | 1.4833 | 91 | 4 | Cancer | summer solstice, maximum shadow |

38/60 | 0.6733 | 181 | 7 | Libra | fall equinox, midpoint shadow |

9/60 | 0.15 | 271 | 10 | Capricorn | winter solstice, minimum shadow |

38/60 | 0.6733 | 361 | 1 | Aries | spring equinox, midpoint shadow |

B. month | he-gal, handuhhu | noon length (modern formula) | mid morning shadow? | possible reduction |
---|---|---|---|---|

B. month | cubits? | cubits | cubits | cubits |

4 | 60/60 | 89/60 | 60/60 | 89/60-(38/60)*.707=62/60 |

5 | 50/60 | 72/60 | 65/60 | 72/60-(38/60)*.707=45/60 |

6 | 40/60 | 60/60 | 70/60 | 60/60-(38/60)*.707=33/60 |

7 | 30/60 | 38/60 | 75/60 | 38/60-(38/60)*.707=11/60 |

8 | 20/60 | 36/60 | 80/60 | 36/60-(38/60)*.707=11/60 |

9 | 10/60 | 22/60 | 85/60 | minus number not used in B. |

10 | (5/60? ) | 9/60 | 90/60 | minus number not used in B. |

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).

table | printed in | TCL WIKI format | |
---|---|---|---|

testcase number: | 1 | ||

shadow 1, master length: | 100. | ||

shadow N1 integer: | 1. | ||

shadow N2 integer: | 2. | ||

alternate angle from N1/N2 ratio: | 26.565 | ||

gnomon length, centimeters: | 100. | ||

gnomon shadow, centimeters: | 200.0 | ||

angle 2, degrees: | 9.462 | ||

angle 3, degrees: | 11.309 | ||

angle 4, degrees: | 14.036 | ||

angle 5, degrees: | 18.434 | ||

1/7 ratio | 8.130 | degrees | |

1/6 ratio | 9.462 | degrees | |

1/5 ratio | 11.309 | degrees | |

1/4 ratio | 14.036 | degrees | |

1/3 ratio | 18.434 | degrees | |

1/2 ratio | 26.565 | degrees | |

2/3 ratio | 33.690 | degrees | |

1/1 ratio | 45.0 | degrees |

table | printed in | TCL WIKI format |
---|---|---|

testcase number: | 2 | |

shadow 1, master length: | 40. | |

shadow N1 integer: | 1. | |

shadow N2 integer: | 9. | |

alternate angle from N1/N2 ratio: | 6.340 | |

gnomon length, centimeters: | 40. | |

gnomon shadow, centimeters: | 360.0 |

table | printed in | TCL WIKI format |
---|---|---|

testcase number: | 3 | |

shadow 1, master length: | 100. | |

shadow N1 integer: | 1. | |

shadow N2 integer: | 12. | |

alternate angle from N1/N2 ratio: | 4.763 | |

gnomon length, centimeters: | 100. | |

gnomon shadow, centimeters: | 1200.0 |

- Babylonian Astronomy, LIS BRACK-BERNSEN AND JOHN M. STEELE†
- Celestial Measurement in Babylonian Astronomy J. M. Steele, 13 Jun 2007
- Lunar Eclipse Astronomy,Kristian Peder Moesgaard,August 2011
- Eclipse Predictions and Earth's Rotation[L1 ]
- Delta T (ΔT) and Universal Time[L2 ]
- Shadow-Length Schemes in Babylonian Astronomy,J. M. Steele, SCIAMVS 14 (2013), 3-39,revised 2012
- Brack-Bernsen, L. and Hunger, H., 2002, “TU 11: A Collection of Rules for the
- Prediction of Lunar Phases and of Month Lengths”, SCIAMVS 3, 3–90, J. M. Steele
- Late Babylonian procedure texts for gnomons ,Mathieu Ossendrijver – 12 february 2014
- Astronomical Instruments In Ancient India, Shekher Narveker,June, 2007,esp.shanku, gnomon
- Early Indian Astronomy by George Abraham
- Hindu Astronomy

# pretty print from autoindent and ased editor # Babylonian Shadow Length calculator # written on windows XP on eTCL # working under TCL version 8.5.6 and eTCL 1.0.1 # gold on TCL WIKI , 14jun2014 # comment follows from gold, 12Dec2018 # pretty print from autoindent and ased editor # Babylonian Shadow Length Calculator V2 # written on Windows XP on TCL # working under TCL version 8.6 # Revamping older program from 2014. # One of my early TCL programs on wiki. package require Tk namespace path {::tcl::mathop ::tcl::mathfunc} frame .frame -relief flat -bg aquamarine4 pack .frame -side top -fill y -anchor center set names {{} {master length centimeters:} } lappend names {N1 integer:} lappend names {N2 integer: } lappend names {angle from N1/N2 ratio degrees: } lappend names {answer: shadow length centimeters} lappend names {angle 3 degrees:} lappend names {angle 4 degrees: } lappend names {angle 5 degrees: } 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 Babylonian Shadow Length V2 from TCL , # gold on TCL Club, 12Dec2018 " tk_messageBox -title "About" -message $msg } proc self_help {} { set msg " Babylonian Shadow Length Calculator V2 from TCL Club , # self help listing # problem, Babylonian Shadow Length Calculator V2 # 3 givens follow. 1) master length centimeters: 2) N1 integer: 3) N2 integer: # 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 to conventional texteditor. # For testcases, testcase number is internal # to the calculator and will not be printed # until the report button is pushed # for the current result numbers. # >>> copyright notice <<< # This posting, screenshots, and TCL source code is # copyrighted under the TCL/TK license terms. # Editorial rights and disclaimers # retained under the TCL/TK license terms # and will be defended as necessary in court. Conventional text editor formulas or formulas grabbed from internet screens can be pasted into green console. # gold on TCL Club, 12Dec2018 " tk_messageBox -title "Self_Help" -message $msg } proc pi {} {expr 1.*acos(-1)} proc radianstodegconst {} {return [/ 180. [pi] ] } proc xradianstodegconst {} {return [/ [pi] 180. ] } proc degz {} {return [/ 180. [pi] ]} proc degx {aa} {return [ expr { [degz]*atan($aa) } ]} proc calculate { } { global answer2 global side1 side2 side3 side4 side5 global side6 side7 side8 testcase_number global length0 shadow incr testcase_number set $side1 [* $side1 1. ] set $side2 [* $side2 1. ] set $side3 [* $side3 1. ] set $side4 [* $side4 1. ] set N1 $side2 set N2 $side3 set length0 $side1 set shadow [* $length0 [/ 1. [/ $N1 $N2 ] ] ] set term1 [/ 1. 7. ] set term2 [/ 1. 6. ] set term3 [/ 1. 5. ] set term4 [/ 1. 4. ] set term5 [/ 1. 3. ] set term7 [/ $N1 $N2 ] set angle1 [ degx $term7 ] set angle2 [ degx $term2 ] set angle3 [ degx $term3 ] set angle4 [ degx $term4 ] set angle5 [ degx $term5 ] set side4 $angle1 set side5 $shadow set side6 $angle3 set side7 $angle4 set side8 $angle5 } 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 side1 side2 side3 side4 side5 global side6 side7 side8 testcase_number global length0 shadow console eval {.console config -bg palegreen} console eval {.console config -font {fixed 20 bold}} console eval {wm geometry . 40x20} console eval {wm title . " Babylonian Shadow Length Calculator V2 Report, screen grab and paste from console 2 to texteditor"} console eval {. configure -background orange -highlightcolor brown -relief raised -border 30} console show; puts "%|table| printed in|TCL format |% " puts "&|testcase number:| $testcase_number| |& " puts "&|shadow 1, master length:| $side1| |& " puts "&|shadow N1 integer: |$side2| |& " puts "&|shadow N2 integer: |$side3| |& " puts "&|alternate angle from N1/N2 ratio: | $side4| |& " puts "&|gnomon length, centimeters: |$length0| |& " puts "&|gnomon shadow, centimeters: |$shadow| |& " puts "&|angle 2, degrees: |$side5| |& " puts "&|angle 3, degrees: |$side6| |& " puts "&|angle 4, degrees: |$side7| |& " puts "&|angle 5, degrees: |$side8| |& " puts "&| 1/7 ratio | [ degx [/ 1. 7. ] ]|degrees | |& " puts "&| 1/6 ratio | [ degx [/ 1. 6. ] ]|degrees | |& " puts "&| 1/5 ratio | [ degx [/ 1. 5. ] ]|degrees | |& " puts "&| 1/4 ratio | [ degx [/ 1. 4. ] ]|degrees | |& " puts "&| 1/3 ratio | [ degx [/ 1. 3. ] ]|degrees | |& " puts "&| 1/2 ratio | [ degx [/ 1. 2. ] ]|degrees | |& " puts "&| 2/3 ratio | [ degx [/ 2. 3. ] ]|degrees | |& " puts "&| 1/1 ratio | [ degx [/ 1. 1. ] ]|degrees | |& " } frame .buttons -bg aquamarine4 ::ttk::button .calculator -text "Solve" -command { calculate } ::ttk::button .test2 -text "Testcase1" -command {clearx;fillup 100. 1. 2. 26.8 200. 11.3 14.0 18.4 } ::ttk::button .test3 -text "Testcase2" -command {clearx;fillup 40. 1. 9. 6.34 360. 11.3 14.0 18.4 } ::ttk::button .test4 -text "Testcase3" -command {clearx;fillup 100. 1. 12. 4.76 1200. 11.3 14.0 18.4 } ::ttk::button .clearallx -text clear -command {clearx } ::ttk::button .about -text about -command about ::ttk::button .self_help -text self_help -command { self_help } ::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 .self_help .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 Shadow Length Calculator V2"

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 (which 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 |&"

# Pretty print version from autoindent # and ased editor # eTCL console program # estimating duration of daylight # written on Windows XP on eTCL # formulas by Dr.Vyacheslav Khavrus # from Parametrical model of Movement Sun # code from TCL WIKI, eTCL console script # 8jul2014, [gold] namespace path {::tcl::mathop ::tcl::mathfunc} console show global testcase_number set testcase_number 0 proc pi {} {expr 1.*acos(-1)} proc radianstodegconst {} {return [/ 180. [pi] ] } proc xradianstodegconst {} {return [/ [pi] 180. ] } proc degz {} {return [/ 180. [pi] ]} proc degx {aa} {return [ expr { [degz]*atan($aa) } ]} proc daylightx { lat obl tday } { global testcase_number incr testcase_number set term1 [/ [* 2. [pi] $tday] 365.25 ] set term2 [sin $term1 ] set dec [* $lat $term2 ] set term3 [acos [* [tan [* [degz] $dec ]] [tan [* [degz] $lat]]]] set daylight [* 24. [- 1. [/ $term3 [pi] ] ] ] puts "%|daylight decimal hours| for days| after spring equinox |% " puts "%|table| printed in|TCL WIKI format |% " puts "&|testcase number:| $testcase_number| |& " puts " &|inputs > latitude N. $lat degrees | obliquity $obl degrees |$tday days spr.eq. |& " puts " &|decimal hours after sunrise | $daylight | |&" puts " &|daylight decimal minutes |[* $daylight 60.]| |& " puts " &|dayight decimal minas| [/ $daylight 4.]| |&" puts " &|dayight decimal beru| [/ $daylight 2.]| |&" puts " &|dayight decimal us units| [* $daylight 15.]| |&" } daylightx 33. 23.44 20. daylightx 33. 23.44 90. daylightx 33. 23.44 180.

daylight decimal hours | for days | after spring equinox |
---|---|---|

table | printed in | TCL WIKI format |

testcase number: | 1 | |

inputs > latitude N. 33. degrees | obliquity 23.44 degrees | 20. days spr.eq. |

decimal hours after sunrise | 11.951 | |

daylight decimal minutes | 717.077 | |

dayight decimal minas | 2.987 | |

dayight decimal beru | 5.975 | |

dayight decimal us units | 179.269 |

daylight decimal hours | for days | after spring equinox |
---|---|---|

table | printed in | TCL WIKI format |

testcase number: | 2 | |

inputs > latitude N. 33. degrees | obliquity 23.44 degrees | 90. days spr.eq. |

decimal hours after sunrise | 18.364 | |

daylight decimal minutes | 1101.872 | |

dayight decimal minas | 4.591 | |

dayight decimal beru | 9.182 | |

dayight decimal us units | 275.468 |

daylight decimal hours | for days | after spring equinox |
---|---|---|

table | printed in | TCL WIKI format |

testcase number: | 3 | |

inputs > latitude N. 33. degrees | obliquity 23.44 degrees | 180. days spr.eq. |

decimal hours after sunrise | 9.655 | |

daylight decimal minutes | 579.329 | |

dayight decimal minas | 2.413 | |

dayight decimal beru | 4.827 | |

dayight decimal us units | 144.832 |

Please place any comments here, Thanks.

Category Numerical Analysis | Category Toys | Category Calculator | Category Mathematics | Category Example | Toys and Games | Category Games | Category Application | Category GUI |