893 POINT2D A1, A2, A3, B1, B2, B3;
898 A1.
x = -1.0; A1.
y = 4.0;
899 A2.
x = 0.0; A2.
y = 5.0;
900 A3.
x = 1.0; A3.
y = 4.0;
901 B1.
x = 1.0; B1.
y = 6.0;
902 B2.
x = 6.0; B2.
y = 1.0;
903 B3.
x = 9.0; B3.
y = 7.0;
906 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0.0475666, 0.000001);
920 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1, 0.000001);
929 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0, 0.000001);
938 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, sqrt(2)-1, 0.000001);
947 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0, 0.000001);
951 A1.
x = -2.0; A1.
y = 0.0;
952 A2.
x = 0.0; A2.
y = 2.0;
953 A3.
x = 2.0; A3.
y = 0.0;
956 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
960 A1.
x = -0.5 / sqrt(2.0); A1.
y = 0.5 / sqrt(2.0);
961 A2.
x = 0.0; A2.
y = 0.5;
962 A3.
x = 0.5 / sqrt(2.0); A3.
y = 0.5 / sqrt(2.0);
965 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0.5, 0.000001);
969 A1.
x = -0.5 / sqrt(2.0); A1.
y = -0.5 / sqrt(2.0);
970 A2.
x = -0.5; A2.
y = 0.0;
971 A3.
x = -0.5 / sqrt(2.0); A3.
y = 0.5 / sqrt(2.0);
974 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0.5, 0.000001);
978 A1.
x = -0.5 / sqrt(2.0); A1.
y = -0.5 / sqrt(2.0);
979 A2.
x = 0.0; A2.
y = -0.5;
980 A3.
x = 0.5 / sqrt(2.0); A3.
y = -0.5 / sqrt(2.0);
983 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0.736813, 0.000001);
987 A1.
x = -1.0; A1.
y = 0.0;
988 A2.
x = 0.0; A2.
y = 1.0;
989 A3.
x = 1.0; A3.
y = 0.0;
992 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0.0, 0.000001);
995 B1.
x = -10.0; B1.
y = 0.0;
996 B2.
x = 0.0 ; B2.
y = 10.0;
997 B3.
x = 10.0 ; B3.
y = 0.0;
1000 A1.
x = -22.0; A1.
y = 0.0;
1001 A2.
x = -17.0; A2.
y = -5.0;
1002 A3.
x = -12.0; A3.
y = 0.0;
1005 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 2.0, 0.000001);
1008 A1.
x = -19.0; A1.
y = 0.0;
1009 A2.
x = -14.0; A2.
y = -5.0;
1010 A3.
x = - 9.0; A3.
y = 0.0;
1013 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
1016 A1.
x = -9.0; A1.
y = 0.0;
1017 A2.
x = -4.0; A2.
y = -5.0;
1018 A3.
x = 1.0; A3.
y = 0.0;
1021 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
1024 A1.
x = -1.0; A1.
y = 0.0;
1025 A2.
x = 4.0; A2.
y = -5.0;
1026 A3.
x = 9.0; A3.
y = 0.0;
1029 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
1032 A1.
x = 1.0; A1.
y = 0.0;
1033 A2.
x = 6.0; A2.
y = -5.0;
1034 A3.
x = 11.0; A3.
y = 0.0;
1037 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
1040 A1.
x = 11.0; A1.
y = 0.0;
1041 A2.
x = 16.0; A2.
y = -5.0;
1042 A3.
x = 21.0; A3.
y = 0.0;
1045 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
1049 A1.
x = -15.0; A1.
y = -6.0;
1050 A2.
x = -10.0; A2.
y = -1.0;
1051 A3.
x = - 5.0; A3.
y = -6.0;
1054 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
1057 A1.
x = -5.0; A1.
y = 0.0;
1058 A2.
x = 0.0; A2.
y = 5.0;
1059 A3.
x = 5.0; A3.
y = 0.0;
1062 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 5.0, 0.000001);
1065 A1.
x = -5.0; A1.
y = 0.0;
1066 A2.
x = 0.0; A2.
y = -5.0;
1067 A3.
x = 5.0; A3.
y = 0.0;
1070 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.