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.geometry.partitioning.AbstractSubHyperplane;
25 import org.hipparchus.geometry.partitioning.Hyperplane;
26 import org.hipparchus.geometry.partitioning.Region;
27
28
29
30
31 public class SubLimitAngle extends AbstractSubHyperplane<Sphere1D, Sphere1D> {
32
33
34
35
36
37 public SubLimitAngle(final Hyperplane<Sphere1D> hyperplane,
38 final Region<Sphere1D> remainingRegion) {
39 super(hyperplane, remainingRegion);
40 }
41
42
43 @Override
44 public double getSize() {
45 return 0;
46 }
47
48
49 @Override
50 public boolean isEmpty() {
51 return false;
52 }
53
54
55 @Override
56 protected AbstractSubHyperplane<Sphere1D, Sphere1D> buildNew(final Hyperplane<Sphere1D> hyperplane,
57 final Region<Sphere1D> remainingRegion) {
58 return new SubLimitAngle(hyperplane, remainingRegion);
59 }
60
61
62 @Override
63 public SplitSubHyperplane<Sphere1D> split(final Hyperplane<Sphere1D> hyperplane) {
64 final double global = hyperplane.getOffset(((LimitAngle) getHyperplane()).getLocation());
65 if (global < -hyperplane.getTolerance()) {
66 return new SplitSubHyperplane<Sphere1D>(null, this);
67 } else if (global > hyperplane.getTolerance()) {
68 return new SplitSubHyperplane<Sphere1D>(this, null);
69 } else {
70 return new SplitSubHyperplane<Sphere1D>(null, null);
71 }
72 }
73
74 }