14 October 2022 10:31:21 PM ellipse_test: C++ version Test ellipse() ellipse_area1_test(): ellipse_area1() computes the area of an ellipse. R = 10 Matrix A = [5,1] [1,2] Area = 104.72 ellipse_area2_test(): ellipse_area2() computes the area of an ellipse. Ellipse: 5 * x^2 + 2 * xy + 2 * y^2 = 10 Area = 104.72 ellipse_area3_test(): ellipse_area3() computes the area of an ellipse. Ellipse: (x/10)^2 + (y/3.33333)^2 = 1 Area = 104.72 ellipse_aspect_ratio_test(): ellipse_aspect_ratio() computes the aspect ratio of an ellipse. A B Ratio 1 0 0 1 0.1 0.1 1 0.2 0.2 1 0.3 0.3 1 0.4 0.4 1 0.5 0.5 1 0.6 0.6 1 0.7 0.7 1 0.8 0.8 1 0.9 0.9 1 1 1 ellipse_eccentricity_test(): ellipse_eccentricity() computes the eccentricity of an ellipse. A B Ecc 1 0 1 1 0.1 0.994987 1 0.2 0.979796 1 0.3 0.953939 1 0.4 0.916515 1 0.5 0.866025 1 0.6 0.8 1 0.7 0.714143 1 0.8 0.6 1 0.9 0.43589 1 1 0 ellipse_flattening_test(): ellipse_flattening() computes the flattening of an ellipse. A B Flat 1 0 1 1 0.1 0.9 1 0.2 0.8 1 0.3 0.7 1 0.4 0.6 1 0.5 0.5 1 0.6 0.4 1 0.7 0.3 1 0.8 0.2 1 0.9 0.1 1 1 0 ellipse_point_dist_2d_test(): ellipse_point_dist_2d() is given a point P, and finds the distance to an ellipse in 2D. The ellipse is (X/R1)^2 + (Y/R2)^2 = 1 R1 = 3 R2 = 2 P DIST -1.2 3.9 2.01236 -0.8 3.6 1.65244 -0.4 3.3 1.31379 0 3 1 0.4 2.7 0.715386 0.8 2.4 0.465363 1.2 2.1 0.257003 1.6 1.8 0.099982 2 1.5 0.00798129 2.4 1.2 4.44089e-16 2.8 0.9 0.0978266 3.2 0.6 0.311499 3.6 0.3 0.623086 4 0 1 4.4 -0.3 1.4164 4.8 -0.6 1.85681 5.2 -0.9 2.31247 ellipse_point_near_2d_test(): ellipse_point_near_2d() is given a point P, and finds the nearest point on an ellipse in 2D. The ellipse is (X/R1)^2 + (Y/R2)^2 = 1 R1 = 3 R2 = 2 P PN -1.2 3.9 -0.823689 1.92314 -0.8 3.6 -0.583461 1.96181 -0.4 3.3 -0.309401 1.98934 0 3 1.83697e-16 2 0.4 2.7 0.344958 1.98673 0.8 2.4 0.723898 1.9409 1.2 2.1 1.13259 1.85199 1.6 1.8 1.56233 1.70738 2 1.5 1.99592 1.49314 2.4 1.2 2.4 1.2 2.8 0.9 2.71979 0.843996 3.2 0.6 2.9087 0.489662 3.6 0.3 2.98422 0.204879 4 0 3 0 4.4 -0.3 2.99203 -0.145716 4.8 -0.6 2.97605 -0.25221 5.2 -0.9 2.9582 -0.332704 ellipse_points_2d_test(): ellipse_points_2d() returns points on an ellipse; Ellipse center is [5,-2] radii R1 = 3 R2 = 1 and angle PSI = 0.523599 and area = 9.42478 Sample points: [7.59808,-0.5] [7.20897,-0.282767] [6.48356,-0.326967] [5.5323,-0.625872] [4.5,-1.13397] [3.54382,-1.77392] [2.80933,-2.44829] [2.40835,-3.05441] [2.40192,-3.5] [2.79103,-3.71723] [3.51644,-3.67303] [4.4677,-3.37413] [5.5,-2.86603] [6.45618,-2.22608] [7.19067,-1.55171] [7.59165,-0.945594] ellipse_points_arc_2d_test(): ellipse_points_arc_2d() returns points on an elliptical arc. The ellipse has center 5 -2 radii R1 = 3 R2 = 1 and angle PSI = 0.523599 The arc extends from THETA1 = 1.5708 to THETA2 = 6.28319 Sample points: [4.5,-1.13397] [3.54382,-1.77392] [2.80933,-2.44829] [2.40835,-3.05441] [2.40192,-3.5] [2.79103,-3.71723] [3.51644,-3.67303] [4.4677,-3.37413] [5.5,-2.86603] [6.45618,-2.22608] [7.19067,-1.55171] [7.59165,-0.945594] [7.59808,-0.5] ellipse_test(): Normal end of execution. 14 October 2022 10:31:21 PM