Sun May 1 11:28:21 2022 hypersphere_test(): Python version: 3.6.9 hypersphere() performs various operations on hyperspheres. hypersphere_area_test(): hypersphere_area() returns the area of a hypersphere in D dimensions. D R Area 1 1.5 2.0000000000000000 2 1.5 9.4247779607693793 3 1.5 28.2743338823081380 4 1.5 66.6198297073531620 5 1.5 133.2396594147063524 6 1.5 235.4539135410267363 7 1.5 376.7262616656428236 8 1.5 554.7752137795919225 9 1.5 760.8345788977260327 10 1.5 980.3687265020660107 11 1.5 1195.1161618310898120 12 1.5 1385.9636350446321558 13 1.5 1535.9596994434016324 14 1.5 1632.7999402495584036 15 1.5 1670.3168219935544130 16 1.5 1648.7975240581708931 17 1.5 1574.2365171427197765 18 1.5 1456.8328656107407824 19 1.5 1309.1320263357399654 20 1.5 1144.1938570277175131 hypersphere_area_sample_test(): hypersphere_area_sample() returns sample points from the surface of a hypersphere in D dimensions. hypersphere_area_sample ( 4 , 1.5 , 5 ): [[-1.43023963 0.76786687 1.33810626 -0.68920334 -0.8850114 ] [-0.00215933 -0.34217572 -0.18912286 -1.29252845 -0.86118029] [ 0.45091203 1.24222466 0.50840683 0.23524083 0.26368835] [ 0.03298889 -0.0131961 -0.40648085 -0.22142878 0.80968622]] hypersphere_to_cartesian_test(): hypersphere_to_cartesian(): R,Theta -> X. cartesian_to_hypersphere(): X -> R,Theta Pick a random X, and compute X2 by converting X to hypersphere and back. Consider norm of difference. D | X - X2 | 1 0.0 1 0.0 1 0.0 1 0.0 1 0.0 2 0.0 2 0.0 2 7.850462293418876e-17 2 0.0 2 0.0 3 0.0 3 7.850462293418876e-17 3 5.551115123125783e-17 3 2.237726045655905e-16 3 2.7755575615628914e-17 4 5.551115123125783e-17 4 1.6653345369377348e-16 4 1.9229626863835638e-16 4 1.1102230246251565e-16 4 6.181460191301304e-16 5 6.206335383118183e-16 5 1.2412670766236366e-16 5 1.1102230246251565e-16 5 1.3092278833360675e-16 5 5.551115123125783e-17 hypersphere_volume_test(): hypersphere_volume() returns the volume of a hypersphere in D dimensions. D R Volume 1 1.5 3.0000000000000000 2 1.5 7.0685834705770345 3 1.5 14.1371669411540672 4 1.5 24.9824361402574375 5 1.5 39.9718978244119043 6 1.5 58.8634783852566841 7 1.5 80.7270560712091765 8 1.5 104.0203525836734855 9 1.5 126.8057631496210007 10 1.5 147.0553089753099130 11 1.5 162.9703857042395327 12 1.5 173.2454543805790195 13 1.5 177.2261191665463400 14 1.5 174.9428507410241309 15 1.5 167.0316821993554299 16 1.5 154.5747678804535212 17 1.5 138.9032221008282022 18 1.5 121.4027388008950652 19 1.5 103.3525283949268356 20 1.5 85.8145392770788078 hypersphere_volume_sample_test(): hypersphere_volume_sample() returns sample points from the volume of a hypersphere in D dimensions. hypersphere_volume_sample ( 4 , 1.5 , 5 ): [[ 0.097454 0.71543047 0.07663484 -0.27638807 0.60257783] [-0.38272473 -0.56708674 -0.81333328 -0.58440095 0.02692493] [ 0.05387821 0.60991305 -0.92605282 0.29175257 -0.51499203] [ 0.6539573 -0.32557631 0.35412884 0.19582904 0.58368471]] hypersphere01_area_test(): hypersphere01_area() returns the area of the unit hypersphere in D dimensions. D Area Area Exact Computed 1 2.0000000000000000 2.0000000000000000 2 6.2831853071795862 6.2831853071795862 3 12.5663706143591707 12.5663706143591725 4 19.7392088021787195 19.7392088021787160 5 26.3189450695716189 26.3189450695716225 6 31.0062766802998198 31.0062766802998162 7 33.0733617923198082 33.0733617923198082 8 32.4696970113341479 32.4696970113341408 9 29.6865801246483585 29.6865801246483549 10 25.5016403987734499 25.5016403987734499 11 20.7251426732889001 20.7251426732888966 12 16.0231532262550687 16.0231532262550687 13 11.8381738121826796 11.8381738121826761 14 8.3897034104910890 8.3897034104910873 15 5.7216492123495666 5.7216492123495666 16 3.7652900857422908 3.7652900857422900 17 2.3966788175913640 2.3966788175913627 18 1.4786259590003079 1.4786259590003075 19 0.8858104195716824 0.8858104195716821 20 0.5161378278002812 0.5161378278002809 hypersphere01_area_sample_test(): hypersphere01_area_sample() returns sample points from the surface of the unit hypersphere in D dimensions. hypersphere01_area_sample ( 4 , 5 ): [[ 0.32407131 -0.7156259 -0.87385063 0.45494841 -0.25195866] [-0.2464883 -0.41620978 0.41984012 -0.1401522 -0.48273203] [ 0.91318947 0.46059797 0.11258149 0.84219892 -0.6723023 ] [ 0.01750148 0.32015387 -0.21781819 -0.25314084 -0.50149401]] hypersphere01_stereograph_test(): hypersphere01_stereograph() applies a stereograph map to points. hypersphere01_stereograph_inverse() inverts the mapping. Pick a random X1 on the hypersphere. Map it to a point X2 on the plane. Map it back to a point X3 on the hypersphere. Consider norm of difference. D || X1 - X3 || 2 1.1102230246251565e-16 2 1.1443916996305594e-16 2 4.364564265557647e-15 2 2.0014830212433605e-16 2 1.1102230246251565e-16 3 2.486410087150353e-16 3 1.1102230246251565e-16 3 1.2412670766236366e-16 3 1.1102230246251565e-16 3 1.1102230246251565e-16 4 1.5700924586837752e-16 4 1.6653345369377348e-16 4 1.1775693440128312e-16 4 1.5700924586837752e-16 4 3.5135859424753843e-16 5 2.0074880843059296e-16 5 2.2890463418088597e-16 5 5.551115123125783e-17 5 0.0 5 8.326672684688674e-17 hypersphere01_volume_test(): hypersphere01_volume() returns the volume of the unit hypersphere in D dimensions. D Volume Volume Exact Computed 1 2.0000000000000000 2.0000000000000000 2 3.1415926535897931 3.1415926535897931 3 4.1887902047863914 4.1887902047863905 4 4.9348022005446790 4.9348022005446790 5 5.2637890139143249 5.2637890139143249 6 5.1677127800499703 5.1677127800499694 7 4.7247659703314007 4.7247659703314016 8 4.0587121264167676 4.0587121264167676 9 3.2985089027387069 3.2985089027387060 10 2.5501640398773451 2.5501640398773451 11 1.8841038793899001 1.8841038793898996 12 1.3352627688545891 1.3352627688545891 13 0.9106287547832831 0.9106287547832828 14 0.5992645293207921 0.5992645293207920 15 0.3814432808233045 0.3814432808233044 16 0.2353306303588932 0.2353306303588931 17 0.1409811069171390 0.1409811069171390 18 0.0821458866111282 0.0821458866111282 19 0.0466216010300885 0.0466216010300885 20 0.0258068913900141 0.0258068913900140 hypersphere01_volume_sample_test(): hypersphere01_volume_sample() returns sample points from the volume of a unit hypersphere in D dimensions. hypersphere01_volume_sample ( 4 , 5 ): [[ 0.29645216 0.05392764 0.58400746 -0.60956489 0.6249307 ] [-0.24474568 -0.46606262 0.52928608 -0.36736937 0.17150871] [-0.56425767 -0.73915317 0.48400103 -0.56180115 0.01671715] [-0.60735431 -0.12201414 0.34931344 -0.26262642 0.28762333]] hypersphere_test(): Normal end of execution. Sun May 1 11:28:21 2022