public class LineTest {
@Test
public void testContains() throws MathIllegalArgumentException, MathArithmeticException {
Vector3D p1 = new Vector3D(0, 0, 1);
Line l = new Line(p1, new Vector3D(0, 0, 2), 1.0e-10);
Assert.assertTrue(l.contains(p1));
Assert.assertTrue(l.contains(new Vector3D(1.0, p1, 0.3, l.getDirection())));
Vector3D u = l.getDirection().orthogonal();
Vector3D v = Vector3D.crossProduct(l.getDirection(), u);
for (double alpha = 0; alpha < 2 * FastMath.PI; alpha += 0.3) {
Assert.assertTrue(! l.contains(p1.add(new Vector3D(FastMath.cos(alpha), u,
FastMath.sin(alpha), v))));
}
}