688 POINT2D A1, A2, A3, B1, B2, B3;
693 A1.
x = -1.0; A1.
y = 4.0;
694 A2.
x = 0.0; A2.
y = 5.0;
695 A3.
x = 1.0; A3.
y = 4.0;
696 B1.
x = 1.0; B1.
y = 6.0;
697 B2.
x = 6.0; B2.
y = 1.0;
698 B3.
x = 9.0; B3.
y = 7.0;
701 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0.0475666, 0.000001);
715 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1, 0.000001);
724 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0, 0.000001);
733 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, sqrt(2)-1, 0.000001);
742 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0, 0.000001);
746 A1.
x = -2.0; A1.
y = 0.0;
747 A2.
x = 0.0; A2.
y = 2.0;
748 A3.
x = 2.0; A3.
y = 0.0;
751 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
755 A1.
x = -0.5 / sqrt(2.0); A1.
y = 0.5 / sqrt(2.0);
756 A2.
x = 0.0; A2.
y = 0.5;
757 A3.
x = 0.5 / sqrt(2.0); A3.
y = 0.5 / sqrt(2.0);
760 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0.5, 0.000001);
764 A1.
x = -0.5 / sqrt(2.0); A1.
y = -0.5 / sqrt(2.0);
765 A2.
x = -0.5; A2.
y = 0.0;
766 A3.
x = -0.5 / sqrt(2.0); A3.
y = 0.5 / sqrt(2.0);
769 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0.5, 0.000001);
773 A1.
x = -0.5 / sqrt(2.0); A1.
y = -0.5 / sqrt(2.0);
774 A2.
x = 0.0; A2.
y = -0.5;
775 A3.
x = 0.5 / sqrt(2.0); A3.
y = -0.5 / sqrt(2.0);
778 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0.736813, 0.000001);
782 A1.
x = -1.0; A1.
y = 0.0;
783 A2.
x = 0.0; A2.
y = 1.0;
784 A3.
x = 1.0; A3.
y = 0.0;
787 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 0.0, 0.000001);
790 B1.
x = -10.0; B1.
y = 0.0;
791 B2.
x = 0.0 ; B2.
y = 10.0;
792 B3.
x = 10.0 ; B3.
y = 0.0;
795 A1.
x = -22.0; A1.
y = 0.0;
796 A2.
x = -17.0; A2.
y = -5.0;
797 A3.
x = -12.0; A3.
y = 0.0;
800 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 2.0, 0.000001);
803 A1.
x = -19.0; A1.
y = 0.0;
804 A2.
x = -14.0; A2.
y = -5.0;
805 A3.
x = - 9.0; A3.
y = 0.0;
808 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
811 A1.
x = -9.0; A1.
y = 0.0;
812 A2.
x = -4.0; A2.
y = -5.0;
813 A3.
x = 1.0; A3.
y = 0.0;
816 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
819 A1.
x = -1.0; A1.
y = 0.0;
820 A2.
x = 4.0; A2.
y = -5.0;
821 A3.
x = 9.0; A3.
y = 0.0;
824 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
827 A1.
x = 1.0; A1.
y = 0.0;
828 A2.
x = 6.0; A2.
y = -5.0;
829 A3.
x = 11.0; A3.
y = 0.0;
832 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
835 A1.
x = 11.0; A1.
y = 0.0;
836 A2.
x = 16.0; A2.
y = -5.0;
837 A3.
x = 21.0; A3.
y = 0.0;
840 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
844 A1.
x = -15.0; A1.
y = -6.0;
845 A2.
x = -10.0; A2.
y = -1.0;
846 A3.
x = - 5.0; A3.
y = -6.0;
849 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 1.0, 0.000001);
852 A1.
x = -5.0; A1.
y = 0.0;
853 A2.
x = 0.0; A2.
y = 5.0;
854 A3.
x = 5.0; A3.
y = 0.0;
857 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 5.0, 0.000001);
860 A1.
x = -5.0; A1.
y = 0.0;
861 A2.
x = 0.0; A2.
y = -5.0;
862 A3.
x = 5.0; A3.
y = 0.0;
865 CU_ASSERT_DOUBLE_EQUAL(dl.
distance, 5.0, 0.000001);
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.
void lw_dist2d_distpts_init(DISTPTS *dl, int mode)