801 POINT2D A1, A2, A3, B1, B2, B3;
806 A1.
x = -1.0; A1.
y = 4.0;
807 A2.
x = 0.0; A2.
y = 5.0;
808 A3.
x = 1.0; A3.
y = 4.0;
809 B1.
x = 1.0; B1.
y = 6.0;
810 B2.
x = 6.0; B2.
y = 1.0;
811 B3.
x = 9.0; B3.
y = 7.0;
814 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0.0475666, 0.000001);
828 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1, 0.000001);
837 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0, 0.000001);
846 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, sqrt(2)-1, 0.000001);
855 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0, 0.000001);
859 A1.
x = -2.0; A1.
y = 0.0;
860 A2.
x = 0.0; A2.
y = 2.0;
861 A3.
x = 2.0; A3.
y = 0.0;
864 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
868 A1.
x = -0.5 / sqrt(2.0); A1.
y = 0.5 / sqrt(2.0);
869 A2.
x = 0.0; A2.
y = 0.5;
870 A3.
x = 0.5 / sqrt(2.0); A3.
y = 0.5 / sqrt(2.0);
873 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0.5, 0.000001);
877 A1.
x = -0.5 / sqrt(2.0); A1.
y = -0.5 / sqrt(2.0);
878 A2.
x = -0.5; A2.
y = 0.0;
879 A3.
x = -0.5 / sqrt(2.0); A3.
y = 0.5 / sqrt(2.0);
882 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0.5, 0.000001);
886 A1.
x = -0.5 / sqrt(2.0); A1.
y = -0.5 / sqrt(2.0);
887 A2.
x = 0.0; A2.
y = -0.5;
888 A3.
x = 0.5 / sqrt(2.0); A3.
y = -0.5 / sqrt(2.0);
891 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0.736813, 0.000001);
895 A1.
x = -1.0; A1.
y = 0.0;
896 A2.
x = 0.0; A2.
y = 1.0;
897 A3.
x = 1.0; A3.
y = 0.0;
900 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0.0, 0.000001);
903 B1.
x = -10.0; B1.
y = 0.0;
904 B2.
x = 0.0 ; B2.
y = 10.0;
905 B3.
x = 10.0 ; B3.
y = 0.0;
908 A1.
x = -22.0; A1.
y = 0.0;
909 A2.
x = -17.0; A2.
y = -5.0;
910 A3.
x = -12.0; A3.
y = 0.0;
913 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 2.0, 0.000001);
916 A1.
x = -19.0; A1.
y = 0.0;
917 A2.
x = -14.0; A2.
y = -5.0;
918 A3.
x = - 9.0; A3.
y = 0.0;
921 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
924 A1.
x = -9.0; A1.
y = 0.0;
925 A2.
x = -4.0; A2.
y = -5.0;
926 A3.
x = 1.0; A3.
y = 0.0;
929 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
932 A1.
x = -1.0; A1.
y = 0.0;
933 A2.
x = 4.0; A2.
y = -5.0;
934 A3.
x = 9.0; A3.
y = 0.0;
937 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
940 A1.
x = 1.0; A1.
y = 0.0;
941 A2.
x = 6.0; A2.
y = -5.0;
942 A3.
x = 11.0; A3.
y = 0.0;
945 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
948 A1.
x = 11.0; A1.
y = 0.0;
949 A2.
x = 16.0; A2.
y = -5.0;
950 A3.
x = 21.0; A3.
y = 0.0;
953 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
957 A1.
x = -15.0; A1.
y = -6.0;
958 A2.
x = -10.0; A2.
y = -1.0;
959 A3.
x = - 5.0; A3.
y = -6.0;
962 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
965 A1.
x = -5.0; A1.
y = 0.0;
966 A2.
x = 0.0; A2.
y = 5.0;
967 A3.
x = 5.0; A3.
y = 0.0;
970 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 5.0, 0.000001);
973 A1.
x = -5.0; A1.
y = 0.0;
974 A2.
x = 0.0; A2.
y = -5.0;
975 A3.
x = 5.0; A3.
y = 0.0;
978 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 5.0, 0.000001);
void lw_dist2d_distpts_init(DISTPTS *dl, int mode)
int lw_dist2d_arc_arc(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3, const POINT2D *B1, const POINT2D *B2, const POINT2D *B3, DISTPTS *dl)
Structure used in distance-calculations.