@Override public boolean epsilonEquals(PilotAlarmPacket other, double epsilon) { return MathTools.epsilonEquals(beepRate, other.beepRate, epsilon); }
@Override public boolean epsilonEquals(WristSensorNoisePacket other, double epsilon) { return MathTools.epsilonEquals(leftWristNoise, other.leftWristNoise, epsilon ) && MathTools.epsilonEquals(rightWristNoise, other.rightWristNoise, epsilon) ; }
@Override public boolean epsilonEquals(Cylinder3d other, double epsilon) { return MathTools.epsilonEquals(height, other.height, epsilon) && MathTools.epsilonEquals(radius, other.radius, epsilon); }
@Override public boolean epsilonEquals(Torus3d other, double epsilon) { return MathTools.epsilonEquals(radius, other.radius, epsilon) && MathTools.epsilonEquals(tubeRadius, other.tubeRadius, epsilon); }
@Override public boolean epsilonEquals(Sphere3d other, double epsilon) { return MathTools.epsilonEquals(radius, other.radius, epsilon); }
@Override public boolean epsilonEquals(LegCompliancePacket other, double epsilon) { if (maxVelocityDeltas.length != other.maxVelocityDeltas.length) return false; for (int i = 0; i < maxVelocityDeltas.length; i++) if (!MathTools.epsilonEquals(maxVelocityDeltas[i], other.maxVelocityDeltas[i], epsilon)) return false; return true; }
@Override public boolean epsilonEquals(SingleJointAnglePacket other, double epsilon) { return other.jointName.equals(this.jointName) && MathTools.epsilonEquals(other.angle, this.angle, epsilon) && MathTools.epsilonEquals(other.trajectoryTime, this.trajectoryTime, epsilon); } }
@Override public boolean epsilonEquals(HeadPosePacket other, double epsilon) { boolean ret = true; ret &= MathTools.epsilonEquals(yaw, other.yaw, epsilon); ret &= MathTools.epsilonEquals(pitch, other.pitch, epsilon); ret &= MathTools.epsilonEquals(roll, other.roll, epsilon); ret &= measuredGravityInWorld.epsilonEquals(other.measuredGravityInWorld, epsilon); ret &= status.equals(other.status); return ret; } }
@Override public boolean epsilonEquals(SimulatedLidarScanPacket other, double epsilon) { boolean ret = true; for (int i = 0; i < ranges.length; i++) { ret &= MathTools.epsilonEquals(ranges[i], other.ranges[i], epsilon); } ret &= params.equals(other.params); return ret; }
public static boolean isQuaternionNormalized(Quat4d quaternion) { double normSquaredQuaternion = computeQuaternionNormSquared(quaternion); if (!MathTools.isFinite(normSquaredQuaternion)) return false; if (!MathTools.epsilonEquals(normSquaredQuaternion, 1, 1e-5)) return false; return true; }
@Override public boolean epsilonEquals(T other, double epsilon) { if (!MathTools.epsilonEquals(time, other.getTime(), epsilon)) return false; if (!waypointData.epsilonEquals(other.waypointData, epsilon)) return false; return true; } }
@Override public final boolean epsilonEquals(T other, double epsilon) { if (!MathTools.epsilonEquals(time, other.getTime(), epsilon)) return false; return waypointData.epsilonEquals(other.waypointData, epsilon); }
@Override public boolean epsilonEquals(YoOneDoFWaypoint other, double epsilon) { if (!MathTools.epsilonEquals(getPosition(), other.getPosition(), epsilon)) return false; if (!MathTools.epsilonEquals(getVelocity(), other.getVelocity(), epsilon)) return false; return true; }
@Override public boolean epsilonEquals(OneDoFWaypoint other, double epsilon) { if (!MathTools.epsilonEquals(getPosition(), other.getPosition(), epsilon)) return false; if (!MathTools.epsilonEquals(getVelocity(), other.getVelocity(), epsilon)) return false; return true; }
@Override public boolean epsilonEquals(TrajectoryPoint1DMessage other, double epsilon) { if (!MathTools.epsilonEquals(getTime(), other.getTime(), epsilon)) return false; if (!MathTools.epsilonEquals(getPosition(), other.getPosition(), epsilon)) return false; if (!MathTools.epsilonEquals(getVelocity(), other.getVelocity(), epsilon)) return false; return true; }
@Override public boolean currentlyMeetsGoal() { return MathTools.epsilonEquals(variableOne.getDoubleValue(), variableTwo.getDoubleValue(), epsilon); }
@Override public boolean epsilonEquals(Box3d other, double epsilon) { return MathTools.epsilonEquals(getWidth(), other.getWidth(), epsilon) && MathTools.epsilonEquals(getLength(), other.getLength(), epsilon) && MathTools.epsilonEquals(getHeight(), other.getHeight(), epsilon); }
@Override public boolean epsilonEquals(YoOneDoFTrajectoryPoint other, double epsilon) { if (!MathTools.epsilonEquals(getTime(), other.getTime(), epsilon)) return false; if (!waypoint1d.epsilonEquals(other.waypoint1d, epsilon)) return false; return true; }
@Override public final boolean epsilonEquals(Y other, double epsilon) { if (!MathTools.epsilonEquals(getTime(), other.getTime(), epsilon)) return false; return super.epsilonEquals(other, epsilon); } }
public boolean isPointOnLine(Point2d point) { double epsilon = 1e-8; if (Math.abs(normalizedVector.getX()) < 10E-10) return MathTools.epsilonEquals(point.x, this.point.getX(), epsilon); // y = A*x + b with point = (x,y) double A = normalizedVector.getY()/normalizedVector.getX(); double b = this.point.getY()-A*this.point.getX(); double value = point.getY() - A*point.getX() - b; return epsilon > Math.abs(value); }