08-Jan-2022 10:37:00 triangle_distance_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test triangle_distance(). triangle_distance_histogram_test MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test triangle_distance_histogram. Number of sample points N = 10000 Equilateral triangle vertices: ( 0, 0 ) ( 1, 0 ) ( 0.5, 0.866025 ) Unit right triangle vertices: ( 0, 0 ) ( 1, 0 ) ( 0, 1 ) 345 right triangle Vertices: ( 0, 0 ) ( 3, 0 ) ( 0, 4 ) scalene triangle Vertices: ( 0.75, 0.9 ) ( 0, 0.2 ) ( 0.95, 0.65 ) triangle_distance_stats_test MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test triangle_distance_stats. Number of sample points N = 10000 Equilateral triangle vertices: ( 0, 0 ) ( 1, 0 ) ( 0.5, 0.866025 ) Estimated mu = 0.362899 Exact mu = 0.364792 Estimated var = 0.0334912 Unit right triangle vertices: ( 0, 0 ) ( 1, 0 ) ( 0, 1 ) Estimated mu = 0.41456 Exact mu = 0.414293 Estimated var = 0.0503168 345 right triangle Vertices: ( 0, 0 ) ( 3, 0 ) ( 0, 4 ) Estimated mu = 1.46688 Estimated var = 0.64638 scalene triangle Vertices: ( 0.75, 0.9 ) ( 0, 0.2 ) ( 0.95, 0.65 ) Estimated mu = 0.29533 Estimated var = 0.0367805 triangle_equilateral_distance_pdf_test MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test triangle_equilateral_distance_pdf, probability density function for the distance D between between a pair of random points in an equilateral triangle. Triangle vertices: ( 0, 0 ) ( 1, 0 ) ( 0.5, 0.866025 ) Graphics saved as "triangle_equilateral_distance_pdf.png" Graphics saved in "triangle_equilateral_distance_compare.png" triangle_right_distance_pdf_test MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test triangle_right_distance_pdf, probability density function for the distance D between a pair of random points in a right triangle. Triangle vertices: ( 0, 0 ) ( 5, 0 ) ( 0, 12 ) Graphics saved as "triangle_right_distance_pdf.png" Graphics saved in "triangle_right_distance_compare.png" triangle_right_error_test MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test triangle_right_error, which reports right triangle error a^2+b^2-c^2 Triangle #1: ( 0, 0 ) ( 3, 0 ) ( 0, 4 ) Right triangle error is 0 Triangle #2: ( 4, 0 ) ( 0, 0 ) ( 0, 3 ) Right triangle error is 0 Triangle #3: ( 0.1, 0 ) ( 3, 0.2 ) ( 0.3, 4 ) Right triangle error is 2.76 Triangle #4: ( 0.664766, 0.0772914 ) ( 0.589446, 0.675279 ) ( 0.366259, 0.0957793 ) Right triangle error is 0.0670781 triangle_sample_test MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test triangle_sample, which uniformly samples a triangle. Number of points N = 10000 Vertices: V1 = 0.750000 0.900000 V2 = 0.000000 0.200000 V3 = 0.950000 0.650000 Graphics saved as "triangle_sample_test.png" triangle_sides_test MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test triangle_sides, which reports the lengths of the sides of a triangle. Triangle #1: ( 0, 0 ) ( 3, 0 ) ( 0, 4 ) a = 3, b = 4, c = 5 Triangle #2: ( 4, 0 ) ( 0, 0 ) ( 0, 3 ) a = 3, b = 4, c = 5 Triangle #3: ( 0.1, 0 ) ( 3, 0.2 ) ( 0.3, 4 ) a = 2.90689, b = 4.005, c = 4.66154 Triangle #4: ( 0.951312, 0.997103 ) ( 0.370334, 0.111745 ) ( 0.0349099, 0.682009 ) a = 0.661598, b = 0.96906, c = 1.05896 triangle_distance_test(): Normal end of execution. 08-Jan-2022 10:38:16