9 May 2025 8:57:33.095 PM circle_segment_test(): Fortran90 version Test circle_segment(). test01(): CIRCLE_SEGMENT_AREA_FROM_HEIGHT() computes the area of a circle segment. R H Area 1.000000 1.000000 1.570796 1.000000 0.500000 0.614185 1.000000 0.250000 0.226656 1.000000 0.125000 0.081753 1.000000 0.062500 0.029185 1.000000 0.031250 0.010368 1.000000 0.015625 0.003674 1.000000 0.007812 0.001301 1.000000 0.003906 0.000460 1.000000 0.001953 0.000163 1.000000 0.000977 0.000058 test05(): For circle segment with a given radius R, CIRCLE_SEGMENT_AREA_FROM_HEIGHT computes the area A, given the height. CIRCLE_SEGMENT_HEIGHT_FROM_AREA computes height H, given the area. Check that these functions are inverses of each other using random values of R, A, and H. R H => A => H2 4.791036 8.927348 69.971053 8.927349 4.408364 5.322211 38.525399 5.322211 1.714302 1.265813 3.096340 1.265813 0.888028 1.424540 2.129946 1.424540 4.177764 3.393254 20.899956 3.393254 R A => H => A2 4.567425 0.560888 0.270179 0.560888 2.125453 11.447322 3.196238 11.447322 1.418025 4.859927 2.038331 4.859927 3.671495 10.129780 2.119920 10.129780 2.376004 12.560484 3.168012 12.560484 test06(): circle_segment_sample_from_height() samples a circle segment. Plot 100 points from several segments. Created boundary file "sample01_boundary.txt". Created data file "sample01_data.txt". Created command file "sample01_commands.txt". Created boundary file "sample02_boundary.txt". Created data file "sample02_data.txt". Created command file "sample02_commands.txt". Created boundary file "sample03_boundary.txt". Created data file "sample03_data.txt". Created command file "sample03_commands.txt". Created boundary file "sample04_boundary.txt". Created data file "sample04_data.txt". Created command file "sample04_commands.txt". test07(): For circle segment with a given radius R, circle_segment_angle_from_height() computes the angle THETA, given the height. circle_segment_height_from_angle() computes height H, given the angle. Check that these functions are inverses of each other using random values of R, T, and H. R H => T => H2 0.086049 0.139342 4.477370 0.139342 0.279420 0.013487 0.623922 0.013487 2.007220 0.709065 1.734981 0.709065 3.476832 0.304639 0.843470 0.304639 3.962960 4.203013 3.262815 4.203013 R T => H => T2 1.244958 1.991813 0.568022 1.991813 2.369582 5.207470 4.404599 5.207470 1.857251 4.670573 3.142783 4.670573 2.022096 0.022522 0.000128 0.022522 0.933954 2.082065 0.461999 2.082065 test08(): circle_segment_contains_point(): reports whether a circle segment contains a point. Pick a circle segment at random. Compute 1000 sample points in the surrounding box. Compare the area of the segment to the percentage of points contained in the circle segment. N Omega1 Omega2 Area Estimate 1000 4.56201 10.0774 3.10496 3.16000 1000 4.19708 6.14633 0.510003 0.396000 1000 4.52775 10.7278 3.14154 3.08000 1000 0.809021 6.85460 3.14048 3.09600 1000 4.19576 9.65919 3.09720 3.10800 test09 circle_segment_area_from_chord() and circle_segment_centroid_from_chord() evaluate the area and centroid of a circle segment, given R, C and P1:P2. circle_segment_area_from_sample() and circle_segment_centroid_from_sample() give us Monte Carlo estimates. Start easy, with R = 1, C = (0,0), and Theta centered. Area CentroidX CentroidY 0.391457E-01 0.954429 0.370870E-15 0.391457E-01 0.954429 -0.00000 0.402124E-01 0.954076 -0.967129E-03 test11(): circle_segment_rotation_from_chord() is given the endpoints of a chord, and is asked to determine the angle of the central radius vector. We make a table of all pairs of angles that are multiples of pi/12, determine the corresponding chord endpoints, and compute the rotation angle, also printed as a multiple of pi/12. 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 0 6.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 1 6.5 7.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 2 7.0 7.5 8.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 3 7.5 8.0 8.5 9.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 4 8.0 8.5 9.0 9.5 10.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 5 8.5 9.0 9.5 10.0 10.5 11.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 6 9.0 9.5 10.0 10.5 11.0 11.5 0.0 6.5 7.0 7.5 8.0 8.5 9.0 7 9.5 10.0 10.5 11.0 11.5 0.0 0.5 1.0 7.5 8.0 8.5 9.0 9.5 8 10.0 10.5 11.0 11.5 0.0 0.5 1.0 1.5 2.0 8.5 9.0 9.5 10.0 9 10.5 11.0 11.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 9.5 10.0 10.5 10 11.0 11.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 10.5 11.0 11 11.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 11.5 12 6.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 test13(): gauss() computes the points and weights for a Gauss quadrature rule, given the ALPHA and BETA recursion coefficients. LEGENDRE RULE Point Weight -0.973907 0.666713E-01 -0.865063 0.149451 -0.679410 0.219086 -0.433395 0.269267 -0.148874 0.295524 0.148874 0.295524 0.433395 0.269267 0.679410 0.219086 0.865063 0.149451 0.973907 0.666713E-01 HERMITE RULE Point Weight -3.43616 0.764043E-05 -2.53273 0.134365E-02 -1.75668 0.338744E-01 -1.03661 0.240139 -0.342901 0.610863 0.342901 0.610863 1.03661 0.240139 1.75668 0.338744E-01 2.53273 0.134365E-02 3.43616 0.764043E-05 LAGUERRE RULE Point Weight 0.137793 0.308441 0.729455 0.401120 1.80834 0.218068 3.40143 0.620875E-01 5.55250 0.950152E-02 8.33015 0.753008E-03 11.8438 0.282592E-04 16.2793 0.424931E-06 21.9966 0.183956E-08 29.9207 0.991183E-12 test14(): r_jacobi() computes recursion coefficients ALPHA and BETA Gauss quadrature rule, given the ALPHA and BETA recursion coefficients. Legendre weight A = 0.00000 B = 0.00000 Alpha Beta 0.00000 2.00000 0.00000 0.333333 0.00000 0.266667 0.00000 0.257143 0.00000 0.253968 0.00000 0.252525 0.00000 0.251748 0.00000 0.251282 0.00000 0.250980 0.00000 0.250774 Chebyshev Type 1 weight A = -0.500000 B = -0.500000 Alpha Beta 0.00000 3.14159 -0.00000 0.500000 -0.00000 0.250000 -0.00000 0.250000 -0.00000 0.250000 -0.00000 0.250000 -0.00000 0.250000 -0.00000 0.250000 -0.00000 0.250000 -0.00000 0.250000 Chebyshev Type 2 weight A = 0.500000 B = 0.500000 Alpha Beta 0.00000 1.57080 0.00000 0.250000 0.00000 0.250000 0.00000 0.250000 0.00000 0.250000 0.00000 0.250000 0.00000 0.250000 0.00000 0.250000 0.00000 0.250000 0.00000 0.250000 General Jacobi weight A = 0.500000 B = 1.50000 Alpha Beta 0.250000 1.57080 0.833333E-01 0.187500 0.416667E-01 0.222222 0.250000E-01 0.234375 0.166667E-01 0.240000 0.119048E-01 0.243056 0.892857E-02 0.244898 0.694444E-02 0.246094 0.555556E-02 0.246914 0.454545E-02 0.247500 circle_segment_test(): Normal end of execution. 9 May 2025 8:57:33.120 PM