Skip to content

Commit

Permalink
Merge branch 'GEOMETRY-29__sven'
Browse files Browse the repository at this point in the history
Closes #31.
  • Loading branch information
Gilles Sadowski committed May 20, 2019
2 parents e94830b + 7a42a6f commit c45647f
Show file tree
Hide file tree
Showing 8 changed files with 640 additions and 318 deletions.
Expand Up @@ -58,7 +58,7 @@ public EnclosingBall<Vector3D> ballOnSupport(final List<Vector3D> support) {

// delegate to 2D disk generator
final DoublePrecisionContext precision = new EpsilonDoublePrecisionContext(BASE_EPS * (norm1(vA) + norm1(vB) + norm1(vC)));
final Plane p = new Plane(vA, vB, vC, precision);
final Plane p = Plane.fromPoints(vA, vB, vC, precision);
final EnclosingBall<Vector2D> disk =
new DiskGenerator().ballOnSupport(Arrays.asList(p.toSubSpace(vA),
p.toSubSpace(vB),
Expand Down
Expand Up @@ -16,6 +16,8 @@
*/
package org.apache.commons.geometry.euclidean.threed;

import java.util.Objects;

import org.apache.commons.geometry.core.partitioning.Embedding;
import org.apache.commons.geometry.core.precision.DoublePrecisionContext;
import org.apache.commons.geometry.euclidean.oned.IntervalsSet;
Expand Down Expand Up @@ -237,4 +239,31 @@ public SubLine wholeLine() {
return new SubLine(this, new IntervalsSet(precision));
}

/** {@inheritDoc} */
@Override
public int hashCode() {
return Objects.hash(direction, precision, zero);
}

/** {@inheritDoc} */
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
Line other = (Line) obj;
return this.direction.equals(other.direction, precision) && this.zero.equals(other.zero, precision);
}

/** {@inheritDoc} */
@Override
public String toString() {
return "Line [direction=" + direction + ", zero=" + zero + "]";
}
}

0 comments on commit c45647f

Please sign in to comment.