直线和圆相切 求交点的单元测试

pull/74/head
cx 6 years ago
parent 478b56b09d
commit c86705ab26

@ -146,6 +146,16 @@ Vector3 {
} }
`; `;
exports[`直线和圆相切 1`] = `
Array [
Vector3 {
"x": 34450.21257120082,
"y": 3606.7814824644443,
"z": 0,
},
]
`;
exports[`相交测试 1`] = ` exports[`相交测试 1`] = `
Vector3 { Vector3 {
"x": 0.5, "x": 0.5,

@ -139,3 +139,13 @@ test('直线和圆 圆心和直线重合的时候', () =>
expect(pts.length).toBe(0); expect(pts.length).toBe(0);
}); });
test('直线和圆相切', () =>
{
let data =
[["Line", 1, 1, 24, false, 7, -1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0.33854166666666696, 0, 1], 1, [23700.893770110895, 6917.069643795053, 0], [34450.21257120082, 3606.4429407977773, 0]], ["Circle", 1, 1, 29, false, 7, -1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 34567.94904695702, 3989.061644487676, 0, 1], 1, 400]]
let cus = loadFile(data) as Array<Curve>;
let pts = cus[0].IntersectWith(cus[1], 0);
expect(pts).toMatchSnapshot();
});

Loading…
Cancel
Save