caryclark@google.com | 639df89 | 2012-01-10 21:46:10 +0000 | [diff] [blame] | 1 | /* |
| 2 | * QuadraticIntersection_TestData.cpp |
| 3 | * edge |
| 4 | * |
| 5 | * Created by Cary Clark on 1/10/12. |
| 6 | * Copyright 2012 __MyCompanyName__. All rights reserved. |
| 7 | * |
| 8 | */ |
| 9 | |
| 10 | #include "QuadraticIntersection_TestData.h" |
| 11 | |
caryclark@google.com | 27accef | 2012-01-25 18:57:23 +0000 | [diff] [blame^] | 12 | const Quadratic quadraticLines[] = { |
| 13 | {{0, 0}, {0, 0}, {1, 0}}, |
| 14 | {{0, 0}, {1, 0}, {0, 0}}, |
| 15 | {{1, 0}, {0, 0}, {0, 0}}, |
| 16 | {{1, 0}, {2, 0}, {3, 0}}, |
| 17 | {{0, 0}, {0, 0}, {0, 1}}, |
| 18 | {{0, 0}, {0, 1}, {0, 0}}, |
| 19 | {{0, 1}, {0, 0}, {0, 0}}, |
| 20 | {{0, 1}, {0, 2}, {0, 3}}, |
| 21 | {{0, 0}, {0, 0}, {1, 1}}, |
| 22 | {{0, 0}, {1, 1}, {0, 0}}, |
| 23 | {{1, 1}, {0, 0}, {0, 0}}, |
| 24 | {{1, 1}, {2, 2}, {3, 3}}, |
| 25 | {{1, 1}, {3, 3}, {3, 3}}, |
| 26 | {{1, 1}, {1, 1}, {2, 2}}, |
| 27 | {{1, 1}, {2, 2}, {1, 1}}, |
| 28 | {{1, 1}, {1, 1}, {3, 3}}, |
| 29 | {{1, 1}, {2, 2}, {4, 4}}, // no coincident |
| 30 | {{1, 1}, {3, 3}, {4, 4}}, |
| 31 | {{1, 1}, {3, 3}, {2, 2}}, |
| 32 | {{1, 1}, {4, 4}, {2, 2}}, |
| 33 | {{1, 1}, {4, 4}, {3, 3}}, |
| 34 | {{2, 2}, {1, 1}, {3, 3}}, |
| 35 | {{2, 2}, {1, 1}, {4, 4}}, |
| 36 | {{2, 2}, {3, 3}, {1, 1}}, |
| 37 | {{2, 2}, {3, 3}, {4, 4}}, |
| 38 | {{2, 2}, {4, 4}, {1, 1}}, |
| 39 | {{2, 2}, {4, 4}, {3, 3}}, |
| 40 | }; |
| 41 | |
| 42 | const size_t quadraticLines_count = sizeof(quadraticLines) / sizeof(quadraticLines[0]); |
| 43 | |
| 44 | static const double F = PointEpsilon * 3; |
| 45 | static const double H = PointEpsilon * 4; |
| 46 | static const double J = PointEpsilon * 5; |
| 47 | static const double K = PointEpsilon * 8; // INVESTIGATE: why are larger multiples necessary? |
| 48 | |
| 49 | const Quadratic quadraticModEpsilonLines[] = { |
| 50 | {{0, F}, {0, 0}, {1, 0}}, |
| 51 | {{0, 0}, {1, 0}, {0, F}}, |
| 52 | {{1, 0}, {0, F}, {0, 0}}, |
| 53 | {{1, H}, {2, 0}, {3, 0}}, |
| 54 | {{F, 0}, {0, 0}, {0, 1}}, |
| 55 | {{0, 0}, {0, 1}, {F, 0}}, |
| 56 | {{0, 1}, {F, 0}, {0, 0}}, |
| 57 | {{H, 1}, {0, 2}, {0, 3}}, |
| 58 | {{0, F}, {0, 0}, {1, 1}}, |
| 59 | {{0, 0}, {1, 1}, {F, 0}}, |
| 60 | {{1, 1}, {F, 0}, {0, 0}}, |
| 61 | {{1, 1+J}, {2, 2}, {3, 3}}, |
| 62 | {{1, 1}, {3, 3}, {3+F, 3}}, |
| 63 | {{1, 1}, {1+F, 1}, {2, 2}}, |
| 64 | {{1, 1}, {2, 2}, {1, 1+F}}, |
| 65 | {{1, 1}, {1, 1+F}, {3, 3}}, |
| 66 | {{1+H, 1}, {2, 2}, {4, 4}}, // no coincident |
| 67 | {{1, 1+K}, {3, 3}, {4, 4}}, |
| 68 | {{1, 1}, {3+F, 3}, {2, 2}}, |
| 69 | {{1, 1}, {4, 4+F}, {2, 2}}, |
| 70 | {{1, 1}, {4, 4}, {3+F, 3}}, |
| 71 | {{2, 2}, {1, 1}, {3, 3+F}}, |
| 72 | {{2+F, 2}, {1, 1}, {4, 4}}, |
| 73 | {{2, 2+F}, {3, 3}, {1, 1}}, |
| 74 | {{2, 2}, {3+F, 3}, {4, 4}}, |
| 75 | {{2, 2}, {4, 4+F}, {1, 1}}, |
| 76 | {{2, 2}, {4, 4}, {3+F, 3}}, |
| 77 | }; |
| 78 | |
| 79 | const size_t quadraticModEpsilonLines_count = sizeof(quadraticModEpsilonLines) / sizeof(quadraticModEpsilonLines[0]); |
| 80 | |
| 81 | const Quadratic quadraticTests[][2] = { |
| 82 | { // one intersection |
| 83 | {{0, 0}, |
| 84 | {0, 1}, |
| 85 | {1, 1}}, |
| 86 | {{0, 1}, |
| 87 | {0, 0}, |
| 88 | {1, 0}} |
| 89 | }, |
| 90 | { // four intersections |
| 91 | {{1, 0}, |
| 92 | {2, 6}, |
| 93 | {3, 0}}, |
| 94 | {{0, 1}, |
| 95 | {6, 2}, |
| 96 | {0, 3}} |
| 97 | } |
| 98 | }; |
| 99 | |
| 100 | const size_t quadraticTests_count = sizeof(quadraticTests) / sizeof(quadraticTests[0]); |