All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Shapes
The Shadow in a Sphere (Posted on 2009-08-19) Difficulty: 3 of 5
Consider a hollow sphere of radius R, in which a light source is placed at its centre. A square plate of side length S is held in place within the sphere by a pole of length L units. The square plate's position is then such that the displacement between the centre of the square and the light source is R-L units.

The square plate is also oriented in a way such that an imaginary line drawn perpendicular to the surface of the plate and passing through the plate's centre will pass through the light source.

Determine the surface area of the shadow formed on the spherical shell, due to the square plate.

No Solution Yet Submitted by Chris, PhD    
Rating: 4.0000 (4 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution solution | Comment 4 of 7 |

Call the center of the sphere point A and the center of the square point B and one corner of the square point C. Segment BC, half the diagonal of the square, has length S/sqrt(2).  Angle CAB is therefore arctan(S/sqrt(2) / (R-L)).

That being the case, the projection of this half-diagonal on the surface of the sphere is an arc of this same angular measure. An adjacent half-diagonal has the same measure, forming a second side of a spherical right triangle, as the projections of these two segments meet at the same right angle that the original semi-diagonals had on the actual square.

Spherical trigonometry can be used to find first one side of the spherical square (which is a great-circle arc as it's the projection of a line segment from the center of the sphere), and then to find one of the non-right angles of the right triangle that's one quarter of the square.

By the spherical law of cosines, the cosine of one side of the shadow is cos(CAB)^2, as the second term drops out since the angle opposite is a right angle, having a cosine equal to zero.

Then the law of sines can be used to find one of the two equal non-right angles of the triangle: its sine = sin(CAB)/sin(arccos(cos(CAB)^2 )).

The area of a spherical triangle is proportional to its spherical excess, that is, the amount by which the total of its angles exceeds pi radians or 180 degrees. So in radians, the spherical excess of this triangle is 2*arcsin(sin(CAB)/sin(arccos(cos(CAB)^2 ))) + pi/2 - pi = 2*arcsin(sin(CAB)/sin(arccos(cos(CAB)^2 ))) - pi/2

When the spherical excess of a triangle itself reaches 2*pi its area is half that of the full sphere. (Consider a hemisphere bounded by a great circle, three points of which are considered to be straight angles, so the total of the angles is three straight angles, or three times the total for a plane triangle.)

The area for the full sphere would be 4*pi*R^2, and of a hemisphere would be 2*pi*R^2. That makes the area for our square shadow 2*pi*R^2 * (2*arcsin(sin(CAB)/sin(arccos(cos(CAB)^2 ))) - pi/2) / (2*pi) or just

R^2 * (2*arcsin(sin(CAB)/sin(arccos(cos(CAB)^2 ))) - pi/2 )

or more explicitly, by substituting arctan(S/sqrt(2) / (R-L)) for CAB:

R^2 * (2*arcsin(sin(arctan(S/sqrt(2) / (R-L)))/sin(arccos(cos(arctan(S/sqrt(2) / (R-L)))^2 ))) - pi/2)

That's just one of the four spherical triangles of equal area that make up the spherical square that is the shadow, so it must be multiplied by 4:

4 * R^2 * (2*arcsin(sin(arctan(S/sqrt(2) / (R-L)))/sin(arccos(cos(arctan(S/sqrt(2) / (R-L)))^2 ))) - pi/2)

Of course the above is predicated on the square of the given size actually fitting in the sphere without its vertices sticking out. otherwise the projection of the square includes portions which are not part of the shadow, as the projection is inward toward the light rather than away. Since half the actual square's diagonal is S/sqrt(2), and the distance from the light source at the center is R-L, the distance of a vertex from the center is sqrt((R-L)^2 + S^2/2). If this is larger than R,then the whole situation does not apply.

Using a sphere of radius R = 1, the formula gives the following. The hyphens indicate when the square exceeds what would fit within the sphere.

                               S
 L      0.1    0.2    0.3    0.4    0.5    0.6    0.7    0.8    0.9
0.01  0.0102 ------ ------ ------ ------ ------ ------ ------ ------
0.02  0.0104 0.0412 ------ ------ ------ ------ ------ ------ ------
0.03  0.0106 0.0421 0.0934 ------ ------ ------ ------ ------ ------
0.04  0.0108 0.0429 0.0953 ------ ------ ------ ------ ------ ------
0.05  0.0111 0.0438 0.0973 0.1698 ------ ------ ------ ------ ------
0.06  0.0113 0.0448 0.0993 0.1733 ------ ------ ------ ------ ------
0.07  0.0115 0.0457 0.1014 0.1769 0.2698 ------ ------ ------ ------
0.08  0.0118 0.0467 0.1036 0.1806 0.2753 ------ ------ ------ ------
0.09  0.0121 0.0477 0.1058 0.1844 0.2809 ------ ------ ------ ------
0.10  0.0123 0.0488 0.1081 0.1883 0.2868 0.4007 ------ ------ ------
0.11  0.0126 0.0499 0.1105 0.1924 0.2928 0.4088 ------ ------ ------
0.12  0.0129 0.0510 0.1130 0.1965 0.2990 0.4172 ------ ------ ------
0.13  0.0132 0.0522 0.1155 0.2009 0.3054 0.4259 ------ ------ ------
0.14  0.0135 0.0534 0.1181 0.2053 0.3120 0.4348 0.5703 ------ ------
0.15  0.0138 0.0546 0.1208 0.2099 0.3188 0.4440 0.5819 ------ ------
0.16  0.0141 0.0559 0.1236 0.2147 0.3258 0.4535 0.5939 ------ ------
0.17  0.0145 0.0572 0.1265 0.2196 0.3331 0.4632 0.6062 ------ ------
0.18  0.0148 0.0586 0.1295 0.2247 0.3406 0.4733 0.6189 0.7737 ------
0.19  0.0152 0.0601 0.1327 0.2300 0.3483 0.4837 0.6320 0.7893 ------
0.20  0.0156 0.0615 0.1359 0.2354 0.3563 0.4944 0.6454 0.8054 ------
0.21  0.0160 0.0631 0.1392 0.2411 0.3646 0.5055 0.6593 0.8220 ------
0.22  0.0164 0.0647 0.1427 0.2469 0.3732 0.5169 0.6736 0.8390 ------
0.23  0.0168 0.0663 0.1463 0.2530 0.3820 0.5287 0.6883 0.8566 1.0297
0.24  0.0172 0.0681 0.1500 0.2592 0.3912 0.5409 0.7035 0.8746 1.0504
0.25  0.0177 0.0699 0.1539 0.2658 0.4007 0.5535 0.7192 0.8932 1.0716
0.26  0.0182 0.0717 0.1579 0.2725 0.4105 0.5665 0.7354 0.9124 1.0934
0.27  0.0187 0.0737 0.1621 0.2795 0.4207 0.5800 0.7521 0.9321 1.1159
0.28  0.0192 0.0757 0.1664 0.2868 0.4312 0.5939 0.7693 0.9524 1.1389
0.29  0.0197 0.0778 0.1710 0.2943 0.4421 0.6083 0.7871 0.9733 1.1626
0.30  0.0203 0.0800 0.1757 0.3022 0.4535 0.6232 0.8054 0.9948 1.1870
0.31  0.0209 0.0823 0.1806 0.3103 0.4652 0.6386 0.8244 1.0171 1.2121
0.32  0.0215 0.0847 0.1857 0.3188 0.4774 0.6546 0.8440 1.0400 1.2379
0.33  0.0221 0.0872 0.1910 0.3276 0.4901 0.6712 0.8643 1.0636 1.2644
0.34  0.0228 0.0898 0.1965 0.3368 0.5032 0.6883 0.8852 1.0879 1.2917
0.35  0.0235 0.0925 0.2023 0.3464 0.5169 0.7061 0.9068 1.1130 1.3198
0.36  0.0243 0.0953 0.2084 0.3563 0.5311 0.7245 0.9292 1.1389 1.3487
0.37  0.0250 0.0983 0.2147 0.3667 0.5459 0.7436 0.9524 1.1656 1.3785
0.38  0.0258 0.1014 0.2213 0.3776 0.5612 0.7635 0.9763 1.1932 1.4091
0.39  0.0267 0.1047 0.2282 0.3889 0.5772 0.7841 1.0011 1.2217 1.4406
0.40  0.0276 0.1081 0.2354 0.4007 0.5939 0.8054 1.0268 1.2511 1.4731
0.41  0.0285 0.1117 0.2430 0.4130 0.6112 0.8276 1.0534 1.2814 1.5065
0.42  0.0295 0.1155 0.2509 0.4259 0.6293 0.8507 1.0809 1.3127 1.5409
0.43  0.0305 0.1195 0.2592 0.4394 0.6482 0.8746 1.1094 1.3451 1.5763
0.44  0.0316 0.1236 0.2680 0.4535 0.6678 0.8995 1.1389 1.3785 1.6128
0.45  0.0328 0.1280 0.2771 0.4682 0.6883 0.9254 1.1695 1.4130 1.6504
0.46  0.0340 0.1327 0.2868 0.4837 0.7097 0.9524 1.2013 1.4486 1.6891
0.47  0.0353 0.1375 0.2969 0.4999 0.7321 0.9804 1.2342 1.4855 1.7290
0.48  0.0366 0.1427 0.3076 0.5169 0.7555 1.0096 1.2683 1.5236 1.7700
0.49  0.0381 0.1481 0.3188 0.5347 0.7799 1.0400 1.3037 1.5629 1.8123
0.50  0.0396 0.1539 0.3307 0.5535 0.8054 1.0716 1.3404 1.6036 1.8559
0.51  0.0412 0.1600 0.3431 0.5732 0.8322 1.1046 1.3785 1.6456 1.9008
0.52  0.0429 0.1664 0.3563 0.5939 0.8601 1.1389 1.4180 1.6891 1.9471
0.53  0.0448 0.1733 0.3703 0.6157 0.8895 1.1747 1.4590 1.7340 1.9947
0.54  0.0467 0.1806 0.3850 0.6386 0.9202 1.2121 1.5017 1.7805 2.0438
0.55  0.0488 0.1883 0.4007 0.6628 0.9524 1.2511 1.5459 1.8285 2.0944
0.56  0.0510 0.1965 0.4172 0.6883 0.9861 1.2917 1.5918 1.8782 2.1465
0.57  0.0534 0.2053 0.4348 0.7152 1.0216 1.3342 1.6395 1.9296 2.2001
0.58  0.0559 0.2147 0.4535 0.7436 1.0588 1.3785 1.6891 1.9827 2.2554
0.59  0.0586 0.2247 0.4733 0.7737 1.0979 1.4247 1.7406 2.0376 2.3123
0.60  0.0615 0.2354 0.4944 0.8054 1.1389 1.4731 1.7941 2.0944 2.3709
0.61  0.0647 0.2469 0.5169 0.8390 1.1821 1.5236 1.8496 2.1531 2.4312
0.62  0.0681 0.2592 0.5409 0.8746 1.2275 1.5763 1.9074 2.2138 2.4933
0.63  0.0717 0.2725 0.5665 0.9124 1.2753 1.6315 1.9673 2.2765 2.5572
0.64  0.0757 0.2868 0.5939 0.9524 1.3255 1.6891 2.0297 2.3414 2.6230
0.65  0.0800 0.3022 0.6232 0.9948 1.3785 1.7494 2.0944 2.4084 2.6907
0.66  0.0847 0.3188 0.6546 1.0400 1.4342 1.8123 2.1616 2.4776 2.7603
0.67  0.0898 0.3368 0.6883 1.0879 1.4930 1.8782 2.2315 2.5491 2.8319
0.68  0.0953 0.3563 0.7245 1.1389 1.5549 1.9471 2.3041 2.6230 2.9054
0.69  0.1014 0.3776 0.7635 1.1932 1.6202 2.0191 2.3794 2.6993 2.9811
0.70  0.1081 0.4007 0.8054 1.2511 1.6891 2.0944 2.4576 2.7780 3.0587
0.71  0.1155 0.4259 0.8507 1.3127 1.7617 2.1731 2.5388 2.8592 3.1385
0.72  0.1236 0.4535 0.8995 1.3785 1.8383 2.2554 2.6230 2.9430 3.2204
0.73  0.1327 0.4837 0.9524 1.4486 1.9192 2.3414 2.7104 3.0294 3.3044
0.74  0.1427 0.5169 1.0096 1.5236 2.0044 2.4312 2.8009 3.1184 3.3906
0.75  0.1539 0.5535 1.0716 1.6036 2.0944 2.5250 2.8948 3.2100 3.4789
0.76  0.1664 0.5939 1.1389 1.6891 2.1893 2.6230 2.9920 3.3044 3.5694
0.77  0.1806 0.6386 1.2121 1.7805 2.2893 2.7252 3.0927 3.4015 3.6620
0.78  0.1965 0.6883 1.2917 1.8782 2.3948 2.8319 3.1968 3.5013 3.7569
0.79  0.2147 0.7436 1.3785 1.9827 2.5060 2.9430 3.3044 3.6039 3.8538
0.80  0.2354 0.8054 1.4731 2.0944 2.6230 3.0587 3.4156 3.7092 3.9529
0.81  0.2592 0.8746 1.5763 2.2138 2.7462 3.1792 3.5303 3.8172 4.0541
0.82  0.2868 0.9524 1.6891 2.3414 2.8758 3.3044 3.6487 3.9279 4.1574
0.83  0.3188 1.0400 1.8123 2.4776 3.0119 3.4345 3.7706 4.0413 4.2626
0.84  0.3563 1.1389 1.9471 2.6230 3.1547 3.5694 3.8960 4.1574 4.3699
0.85  0.4007 1.2511 2.0944 2.7780 3.3044 3.7092 4.0250 4.2759 4.4791
0.86  0.4535 1.3785 2.2554 2.9430 3.4611 3.8538 4.1574 4.3970 4.5901
0.87  0.5169 1.5236 2.4312 3.1184 3.6247 4.0032 4.2931 4.5205 4.7029
0.88  0.5939 1.6891 2.6230 3.3044 3.7954 4.1574 4.4321 4.6463 4.8174
0.89  0.6883 1.8782 2.8319 3.5013 3.9730 4.3160 4.5741 4.7743 4.9336
0.90  0.8054 2.0944 3.0587 3.7092 4.1574 4.4791 4.7192 4.9044 5.0512
0.91  0.9524 2.3414 3.3044 3.9279 4.3483 4.6463 4.8670 5.0364 5.1702
0.92  1.1389 2.6230 3.5694 4.1574 4.5455 4.8174 5.0174 5.1702 5.2905
0.93  1.3785 2.9430 3.8538 4.3970 4.7485 4.9922 5.1702 5.3056 5.4120
0.94  1.6891 3.3044 4.1574 4.6463 4.9570 5.1702 5.3251 5.4425 5.5345
0.95  2.0944 3.7092 4.4791 4.9044 5.1702 5.3511 5.4818 5.5806 5.6579
0.96  2.6230 4.1574 4.8174 5.1702 5.3876 5.5345 5.6402 5.7198 5.7820
0.97  3.3044 4.6463 5.1702 5.4425 5.6084 5.7198 5.7998 5.8599 5.9068
0.98  4.1574 5.1702 5.5345 5.7198 5.8318 5.9068 5.9604 6.0006 6.0320
0.99  5.1702 5.7198 5.9068 6.0006 6.0571 6.0947 6.1216 6.1418 6.1575

by comparison the area of the full sphere is 12.56637061435917.


With radius 2:


                                 S
 L     0.2    0.4    0.6    0.8    1.0    1.2    1.4    1.6    1.8
0.10  0.0443 0.1753 0.3892 0.6792 ------ ------ ------ ------ ------
0.12  0.0451 0.1790 0.3973 0.6932 ------ ------ ------ ------ ------
0.14  0.0461 0.1829 0.4057 0.7075 1.0791 ------ ------ ------ ------
0.16  0.0472 0.1868 0.4144 0.7223 1.1011 ------ ------ ------ ------
0.18  0.0482 0.1909 0.4233 0.7375 1.1238 ------ ------ ------ ------
0.20  0.0492 0.1951 0.4325 0.7532 1.1471 1.6027 ------ ------ ------
0.22  0.0504 0.1995 0.4420 0.7694 1.1712 1.6353 ------ ------ ------
0.24  0.0515 0.2040 0.4518 0.7862 1.1960 1.6689 ------ ------ ------
0.26  0.0527 0.2086 0.4620 0.8034 1.2216 1.7035 ------ ------ ------
0.28  0.0539 0.2135 0.4724 0.8213 1.2480 1.7392 2.2812 ------ ------
0.30  0.0552 0.2184 0.4833 0.8397 1.2752 1.7760 2.3277 ------ ------
0.32  0.0564 0.2236 0.4945 0.8588 1.3034 1.8138 2.3756 ------ ------
0.34  0.0578 0.2289 0.5061 0.8785 1.3324 1.8529 2.4248 ------ ------
0.36  0.0593 0.2345 0.5182 0.8988 1.3624 1.8932 2.4756 3.0947 ------
0.38  0.0607 0.2402 0.5306 0.9199 1.3934 1.9347 2.5278 3.1573 ------
0.40  0.0622 0.2462 0.5435 0.9417 1.4254 1.9776 2.5817 3.2217 ------
0.42  0.0638 0.2523 0.5569 0.9643 1.4585 2.0219 2.6372 3.2880 ------
0.44  0.0655 0.2587 0.5707 0.9877 1.4927 2.0676 2.6943 3.3562 ------
0.46  0.0672 0.2654 0.5851 1.0119 1.5281 2.1148 2.7533 3.4263 4.1188
0.48  0.0689 0.2723 0.6000 1.0370 1.5647 2.1636 2.8141 3.4985 4.2014
0.50  0.0708 0.2795 0.6155 1.0630 1.6027 2.2140 2.8768 3.5729 4.2864
0.52  0.0727 0.2870 0.6316 1.0900 1.6420 2.2660 2.9415 3.6494 4.3737
0.54  0.0747 0.2947 0.6484 1.1180 1.6826 2.3199 3.0082 3.7283 4.4634
0.56  0.0768 0.3028 0.6658 1.1471 1.7248 2.3756 3.0771 3.8095 4.5557
0.58  0.0790 0.3112 0.6838 1.1773 1.7685 2.4332 3.1483 3.8931 4.6505
0.60  0.0812 0.3200 0.7027 1.2087 1.8138 2.4928 3.2217 3.9794 4.7481
0.62  0.0836 0.3292 0.7223 1.2413 1.8609 2.5546 3.2976 4.0682 4.8484
0.64  0.0860 0.3387 0.7427 1.2752 1.9097 2.6185 3.3760 4.1598 4.9516
0.66  0.0886 0.3487 0.7640 1.3105 1.9603 2.6847 3.4570 4.2543 5.0577
and 
                                 S
 L     0.2     0.4     0.6     0.8     1.0     1.2     1.4     1.6     1.8
1.10  0.1951  0.7532  1.6027  2.6513  3.8095  5.0043  6.1836  7.3142  8.3776
1.12  0.2040  0.7862  1.6689  2.7533  3.9446  5.1669  6.3673  7.5129  8.5859
1.14  0.2135  0.8213  1.7392  2.8609  4.0863  5.3367  6.5582  7.7183  8.8005
1.16  0.2236  0.8588  1.8138  2.9746  4.2351  5.5139  6.7564  7.9308  9.0216
1.18  0.2345  0.8988  1.8932  3.0947  4.3914  5.6990  6.9623  8.1505  9.2492
1.20  0.2462  0.9417  1.9776  3.2217  4.5557  5.8923  7.1762  8.3776  9.4836
1.22  0.2587  0.9877  2.0676  3.3562  4.7284  6.0942  7.3985  8.6124  9.7249
1.24  0.2723  1.0370  2.1636  3.4985  4.9100  6.3053  7.6294  8.8552  9.9733
1.26  0.2870  1.0900  2.2660  3.6494  5.1010  6.5258  7.8694  9.1061 10.2289
1.28  0.3028  1.1471  2.3756  3.8095  5.3021  6.7564  8.1186  9.3655 10.4920
1.30  0.3200  1.2087  2.4928  3.9794  5.5139  6.9974  8.3776  9.6335 10.7627
1.32  0.3387  1.2752  2.6185  4.1598  5.7370  7.2494  8.6466  9.9105 11.0411
1.34  0.3591  1.3473  2.7533  4.3516  5.9720  7.5129  8.9260 10.1966 11.3274
1.36  0.3814  1.4254  2.8981  4.5557  6.2198  7.7884  9.2162 10.4920 11.6217
1.38  0.4057  1.5103  3.0539  4.7729  6.4809  8.0764  9.5176 10.7971 11.9242
1.40  0.4325  1.6027  3.2217  5.0043  6.7564  8.3776  9.8304 11.1120 12.2349
1.42  0.4620  1.7035  3.4027  5.2509  7.0469  8.6924 10.1551 11.4369 12.5540
1.44  0.4945  1.8138  3.5981  5.5139  7.3534  9.0216 10.4920 11.7719 12.8815
1.46  0.5306  1.9347  3.8095  5.7946  7.6767  9.3655 10.8415 12.1174 13.2176
1.48  0.5707  2.0676  4.0383  6.0942  8.0178  9.7249 11.2038 12.4734 13.5623
1.50  0.6155  2.2140  4.2864  6.4143  8.3776 10.1002 11.5792 12.8401 13.9156
1.52  0.6658  2.3756  4.5557  6.7564  8.7571 10.4920 11.9681 13.2176 14.2775
1.54  0.7223  2.5546  4.8484  7.1220  9.1573 10.9010 12.3706 13.6060 14.6482
1.56  0.7862  2.7533  5.1669  7.5129  9.5792 11.3274 12.7871 14.0053 15.0274
1.58  0.8588  2.9746  5.5139  7.9308 10.0238 11.7719 13.2176 14.4155 15.4153
1.60  0.9417  3.2217  5.8923  8.3776 10.4920 12.2349 13.6623 14.8367 15.8116
1.62  1.0370  3.4985  6.3053  8.8552 10.9848 12.7167 14.1214 15.2688 16.2164
1.64  1.1471  3.8095  6.7564  9.3655 11.5031 13.2176 14.5947 15.7117 16.6294
1.66  1.2752  4.1598  7.2494  9.9105 12.0475 13.7378 15.0823 16.1653 17.0505
1.68  1.4254  4.5557  7.7884 10.4920 12.6188 14.2775 15.5841 16.6294 17.4796
1.70  1.6027  5.0043  8.3776 11.1120 13.2176 14.8367 16.0999 17.1037 17.9163
1.72  1.8138  5.5139  9.0216 11.7719 13.8442 15.4153 16.6294 17.5881 18.3605
1.74  2.0676  6.0942  9.7249 12.4734 14.4989 16.0130 17.1723 18.0820 18.8117
1.76  2.3756  6.7564 10.4920 13.2176 15.1815 16.6294 17.7282 18.5852 19.2698
1.78  2.7533  7.5129 11.3274 14.0053 15.8919 17.2641 18.2966 19.0972 19.7342
1.80  3.2217  8.3776 12.2349 14.8367 16.6294 17.9163 18.8767 19.6175 20.2047
1.82  3.8095  9.3655 13.2176 15.7117 17.3932 18.5852 19.4680 20.1456 20.6808
1.84  4.5557 10.4920 14.2775 16.6294 18.1819 19.2698 20.0697 20.6808 21.1620
1.86  5.5139 11.7719 15.4153 17.5881 18.9941 19.9687 20.6808 21.2225 21.6479
1.88  6.7564 13.2176 16.6294 18.5852 19.8278 20.6808 21.3004 21.7700 22.1378
1.90  8.3776 14.8367 17.9163 19.6175 20.6808 21.4044 21.9274 22.3225 22.6314
1.92 10.4920 16.6294 19.2698 20.6808 21.5503 22.1378 22.5607 22.8794 23.1280
1.94 13.2176 18.5852 20.6808 21.7700 22.4336 22.8794 23.1992 23.4396 23.6270
1.96 16.6294 20.6808 22.1378 22.8794 23.3274 23.6270 23.8415 24.0025 24.1279
1.98 20.6808 22.8794 23.6270 24.0025 24.2282 24.3788 24.4865 24.5672 24.6300

Where the area of the full sphere is 50.26548245743669


All of these are reasonable in that when L is small, the area is only a little larger than S^2, and that when L is almost the full value of R, almost half the sphere is in shadow, and the more so for larger S values. Also it scales correctly, as for example when R=2, L=1.60 and S = 1.0, the shadow size is 10.4920, or four times the area when the linear dimensions are all halved: at R=1, L=0.80, S = 0.5, the shadow area is 2.6230, one quarter as big.

The program for these tables is (apart from the changing for...next values and the value of R to accommodate the differences between these tables.

DECLARE FUNCTION acos! (x!)
DECLARE FUNCTION asin# (x#)
DEFDBL A-Z

DIM SHARED pi
pi = ATN(1) * 4

CLS

r = 2


PRINT "     ";
FOR s = .2# TO 1.8001 STEP .2#
   PRINT USING "  #.#  "; s;
NEXT s
PRINT


FOR l = 1.1# TO 1.999999 STEP .02
  PRINT USING "#.## "; l;
  FOR s = .2# TO 1.8001 STEP .2#
     size = SQR((r - l) ^ 2 + s ^ 2 / 2)
     IF size > r THEN
      PRINT " ------";
     ELSE
      a = r ^ 2 * (2 * asin(SIN(ATN(s / SQR(2) / (r - l))) / SIN(acos(COS(ATN(s / SQR(2) / (r - l))) ^ 2))) - pi / 2)
      PRINT USING "##.####"; a * 4;
     END IF
  NEXT s
  PRINT
NEXT l
PRINT 4 * pi * r * r

DEFSNG A-Z
FUNCTION acos (x)
 s = SQR(1 - x * x)
 acos = ATN(s / x)
END FUNCTION

DEFDBL A-Z
FUNCTION asin (x)
 c = SQR(1 - x * x)
 asin = ATN(x / c)
END FUNCTION

 

 

 

Edited on August 19, 2009, 7:23 pm
  Posted by Charlie on 2009-08-19 19:22:12

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (4)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2017 by Animus Pactum Consulting. All rights reserved. Privacy Information