1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.hipparchus.geometry.spherical.oned;
23
24 import org.hipparchus.exception.MathIllegalArgumentException;
25 import org.hipparchus.util.MathUtils;
26 import org.junit.Assert;
27 import org.junit.Test;
28
29 public class LimitAngleTest {
30
31 @Test
32 public void testReversedLimit() {
33 for (int k = -2; k < 3; ++k) {
34 LimitAngle l = new LimitAngle(new S1Point(1.0 + k * MathUtils.TWO_PI), false, 1.0e-10);
35 Assert.assertEquals(l.getLocation().getAlpha(), l.getReverse().getLocation().getAlpha(), 1.0e-10);
36 Assert.assertEquals(l.getTolerance(), l.getReverse().getTolerance(), 1.0e-10);
37 Assert.assertTrue(l.sameOrientationAs(l));
38 Assert.assertFalse(l.sameOrientationAs(l.getReverse()));
39 Assert.assertEquals(MathUtils.TWO_PI, l.wholeSpace().getSize(), 1.0e-10);
40 Assert.assertEquals(MathUtils.TWO_PI, l.getReverse().wholeSpace().getSize(), 1.0e-10);
41 }
42 }
43
44 @Test(expected=MathIllegalArgumentException.class)
45 public void testTooSmallTolerance() {
46 new LimitAngle(new S1Point(1.0), false, 0.9 * Sphere1D.SMALLEST_TOLERANCE);
47 }
48
49 }