>> triangle_distance_test 17-Apr-2019 09:38:42 triangle_distance_test: MATLAB version Test triangle_distance. triangle_distance_histogram_test MATLAB version 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 version triangle_distance_stats. Number of sample points N = 10000 Equilateral triangle vertices: ( 0, 0 ) ( 1, 0 ) ( 0.5, 0.866025 ) Estimated mu = 0.365859 Exact mu = 0.364792 Estimated var = 0.0338337 Unit right triangle vertices: ( 0, 0 ) ( 1, 0 ) ( 0, 1 ) Estimated mu = 0.415772 Exact mu = 0.414293 Estimated var = 0.0508715 345 right triangle Vertices: ( 0, 0 ) ( 3, 0 ) ( 0, 4 ) Estimated mu = 1.45299 Estimated var = 0.662832 scalene triangle Vertices: ( 0.75, 0.9 ) ( 0, 0.2 ) ( 0.95, 0.65 ) Estimated mu = 0.298591 Estimated var = 0.0377876 triangle_equilateral_distance_pdf_test MATLAB version 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 version 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 version 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.991304, 0.656617 ) ( 0.493904, 0.847203 ) ( 0.701086, 0.606861 ) Right triangle error is -0.0963388 triangle_sample_test MATLAB version 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 version 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.00705596, 0.695527 ) ( 0.651062, 0.107304 ) ( 0.383191, 0.757669 ) a = 0.381233, b = 0.703371, c = 0.87221 triangle_distance_test: Normal end of execution. 17-Apr-2019 09:39:54 >>