use of org.hipparchus.geometry.spherical.twod.Circle in project Orekit by CS-SI.
the class EllipsoidTessellator method meetInside.
/**
* Check if an arc meets the inside of a zone.
* @param s1 first point
* @param s2 second point
* @param zone zone to check arc against
* @return true if the arc meets the inside of the zone
*/
private boolean meetInside(final S2Point s1, final S2Point s2, final SphericalPolygonsSet zone) {
final Circle circle = new Circle(s1, s2, zone.getTolerance());
final double alpha1 = circle.toSubSpace(s1).getAlpha();
final double alpha2 = MathUtils.normalizeAngle(circle.toSubSpace(s2).getAlpha(), alpha1 + FastMath.PI);
final SubCircle sub = new SubCircle(circle, new ArcsSet(alpha1, alpha2, zone.getTolerance()));
return recurseMeetInside(zone.getTree(false), sub);
}
use of org.hipparchus.geometry.spherical.twod.Circle in project Orekit by CS-SI.
the class SphericalPolygonsSetTransferObject method rebuildZone.
/**
* Rebuild the zone from saved data.
* @return rebuilt zone
*/
public SphericalPolygonsSet rebuildZone() {
// rebuild the tree from the flattened arrays
BSPTree<Sphere2D> node = new BSPTree<Sphere2D>();
final int nbNodes = cuts.length / 3 + leafs.length;
cutIndex = 0;
flagIndex = 0;
for (nodeIndex = 0; nodeIndex < nbNodes; ++nodeIndex) {
if (leafs[flagIndex] == nodeIndex) {
// this is a leaf node
node.setAttribute(Boolean.valueOf(flags[flagIndex++]));
while (node.getParent() != null) {
final BSPTree<Sphere2D> parent = node.getParent();
if (node == parent.getMinus()) {
node = parent.getPlus();
break;
} else {
node = parent;
}
}
} else {
// this is an internal node
final double x = cuts[cutIndex++];
final double y = cuts[cutIndex++];
final double z = cuts[cutIndex++];
node.insertCut(new Circle(new Vector3D(x, y, z), tolerance));
node = node.getMinus();
}
}
return new SphericalPolygonsSet(node, tolerance);
}
Aggregations