#!C:\Users\Vinyasi\Perl-5.34.0-Windows\perl.exe # Table of Sacred Cuts of the Square, by Vinyasi. # This file was originally formed on: 13 Dec. 2003 but whose principle was discovered earlier on a 1k RAM PC sometime between 1994 and 1997. # It was modified on: 6 Dec. 2023. # No rights reserved. Copy left. # Originally downloadable from: http://vinyasi.mayashastra.org/book/zip/sacred_square.zip # But currently downloadable from: http://vinyasi.info/Infinite%20Range%20of%20Golden%20Ratios/original%20research%20during%201994%20to%201997/ # HINT ... # RUN THIS PROGRAM IN A PRE-EXISTING COMMAND PROMPT WINDOW TO BE ABLE TO VIEW THE DEBUG LINES OF SOFTWARE CODE # OR ELSE ... # COMMENT OUT THE DEBUG LINES $data = "data.txt"; # NAME OF TEXT FILE TO WRITE SUCCESSFUL OUTCOMES TO open(OUT, ">", $data) or die "open $data failed: $!"; # use ">>" for appending to file or use ">" for erasing file and rewriting to it #print "Content-Type: text/html\n\n"; # print OUT "Sacred Square Cuts Among Even-Sided Polygons", "\n\n"; # use constant PI => 4 * atan2 1, 1; $printErrorMsg = 1; # UNCOMMENT TO DEBUG $prynt = 1; $shift = 100000; $start = 2; # minimum search value for primes $limit = 10; # 100; # maximum numeric value to search for primes which meet the criteria for a silver ratio; usually defaults to 5 $safelimit = 10; # accuracy of search to this many digits # #

Sacred Square Cuts Among Even-Sided Polygons

print OUT ">> Search range is from ", $start, " to ", $limit, " <<\n\n"; print "BEGIN DEBUGGING OUTPUT\n\n"; # UNCOMMENT TO DEBUG for($x1 = $start; $x1 <= $limit; $x1++) { # even sides print "\n\$x1 = $x1 >> \$x1 FOR LOOP >> THIS IS SUPPOSED TO BE A PRIME NUMBER\n"; # UNCOMMENT TO DEBUG $printErrorMsg = 1; # UNCOMMENT TO DEBUG $prynt = 1; $mod = "false"; for($x2 = $start; $x2 <= sqrt($x1); $x2++) { print " \$x2 = $x2 >> \$x2 FOR LOOP >> $x2 IS LESS THAN OR EQUAL TO THE SQUARE ROOT OF $x1\n"; # UNCOMMENT TO DEBUG if($x1 % $x2 == 0) { print " ", $x1 % $x2, " = $x1 MOD $x2 >> PRIMALITY TEST HAS FAILED.\n I AM SKIPPING TO THE NEXT INTEGER ...\n"; # UNCOMMENT TO DEBUG $mod = "true"; last; }} if($mod eq "false") { $read = ""; $tot_sides = $x1 * 4; # even sides print " $tot_sides = $x1 TIMES 4 >> QUADRATURE OF SIDES\n"; # UNCOMMENT TO DEBUG $readout = "\n". $x1. "p ". $tot_sides. "-Gon\n"; $num_ang = $tot_sides / 2; # even sides print " $num_ang = $tot_sides DIVIDED BY 2 >> NUMBER OF ANGLES TO COMPUTE\n"; # UNCOMMENT TO DEBUG $ang = 360 / $tot_sides; # even sides print " $ang DEGREES >> SMALLEST ANGLE TO COMPUTE\n"; # UNCOMMENT TO DEBUG for($x3 = 1; $x3 <= $num_ang; $x3++) { # even sides $angle = $ang * $x3; print " $angle = $ang TIMES $x3 >> \$x3 FOR LOOP >> USE THIS ANGLE OF $angle DEGREES\n"; # UNCOMMENT TO DEBUG $sin[$x3] = 2 * sin(PI * $angle / 360); # even sides print " $sin[$x3] = 2 TIMES sin(PI DIVIDED BY (", $tot_sides / $x3, " = $tot_sides DIVIDED BY $x3)) >> CALCULATE THE UNIT LENGTH OF CHORD #$x3 IN A CIRCLE OF ONE UNIT RADIUS\n"; # UNCOMMENT TO DEBUG $readout .= "Angle No.". $x3. ", {Sin(". (int(int($angle * $shift + 1) / $shift)); $readout .= "° ÷ 2)} x 2 = ". $sin[$x3]. "\n"; } for($x4 = 1; $x4 <= $num_ang; $x4++) { # even sides for($x5 = ($x4 + 1); $x5 <= $num_ang; $x5++) { # even sides for($x7 = 1; $x7 <= $num_ang; $x7++) { # even sides $prynt = 1; for($x8 = ($x7 + 1); $x8 <= $num_ang; $x8++) { # even sides for($alt_sign = -1; $alt_sign <= 1; $alt_sign += 2) { $bsign = "- "; $csign = "+ "; $sin2sign = "+ "; for($alt1 = -1; $alt1 <= 1; $alt1 += 2) { for($alt2 = -1; $alt2 <= 1; $alt2 += 2) { $alt3 = $alt1 * (-1); $alt4 = $alt2 * (-1); $al1 = ''; $al2 = ''; $al3 = ''; $al4 = ''; $al1 = "-" if($alt1 < 0); $al2 = "-" if($alt2 < 0); $al3 = "-" if($alt3 < 0); $al4 = "-" if($alt4 < 0); $sin1 = $sin[$x4] ** ($alt1) * $sin[$x5] ** ($alt3); $sin2 = $sin[$x7] ** ($alt2) * $sin[$x8] ** ($alt4); $be = $sin1 + ($alt_sign * $sin2); $ce = $alt_sign * $sin1 * $sin2; if($alt_sign < 0) { $sin2 = abs($sin2); $sin2sign = "- "; } if($be < 0) { $be = abs($be); $bsign = "+ "; } if($ce < 0) { $ce = abs($ce); $csign = "- "; } if($be != 0 and length $be < $safelimit and length $ce < $safelimit and (length $sin1 >= $safelimit or length $sin2 >= $safelimit)) { if(!$read) { print "\n>>> SUCCESS! GATHER UP ALL OF THE INFORMATION AND SEND IT TO A TEXT FILE WITH THE FILE-NAME OF: $data\n"; # UNCOMMENT TO DEBUG $read = "yes"; print OUT $readout, "\n"; } $ae = 1; if($ce =~ /\./) { $ae *= 1 / $ce; $be *= 1 / $ce; $ce *= 1 / $ce; } if($prynt == 1) { $prynt = 0; print OUT "When the reciprocal of Angle No.", $x4, " (", 1 / $sin[$x4], ") is multiplied by Angle No.", $x5, " (", $sin[$x5], "), then this equals the length of a diagonal: "; print OUT $sin1, "."; print OUT " Likewise, when Angle No.", $x7, " (", $sin[$x7], ") is multiplied by the reciprocal of Angle No.", $x8, " (", 1 / $sin[$x8], "), then this yields the length of another diagonal: "; print OUT $sin2sign, $sin2, "."; print OUT " And when the first diagonal is divided by the second diagonal, and when the negation of the second diagonal is divided by the first diagonal, then this yields the two roots of a quadratic polynomial: "; print OUT "{", $sin1, ", ", $sin2sign, $sin2, "}", " = "; print OUT $ae if($ae != 1); print OUT "x^2 ", $bsign; print OUT $be if($be ne '1'); print OUT "x ", $csign, $ce, ".\n\n"; } } else { if($printErrorMsg == 1) { # UNCOMMENT TO DEBUG $printErrorMsg = 0; # UNCOMMENT TO DEBUG print "\n>>> HAVE EXHAUSTED SEARCHING FOR ANY MORE POLYNOMIALS OF INTEGER COEFFICIENTS FOR THE PRIME NUMBER OF $x1.\n"; } # UNCOMMENT TO DEBUG }}}}}}}} undef @sin; }} close OUT; print "\n\nEND DEBUGGING OUTPUT\n"; # UNCOMMENT TO DEBUG exit;