/** * Provides a {@code String} representation of this spatial vector as follows:<br> * Spatial Vector: [angular = (x, y, z), linear = (x, y, z)] - expressedInFrame * * @return the {@code String} representing this spatial vector. */ @Override public String toString() { return MecanoIOTools.getSpatialVectorString(this); } }
/** * Gets a representative {@code String} of {@code spatialVector} as follows: * * <pre> * Spatial Vector: [angular = ( 0.174, 0.732, -0.222 ), linear = ( 0.174, 0.732, -0.222 )] - expressedInFrame * </pre> * </p> * * @param spatialVector the object to get the {@code String} of. Not modified. * @return the representative {@code String}. */ public static String getSpatialVectorString(SpatialVectorReadOnly spatialVector) { return getSpatialVectorString(DEFAULT_FORMAT, spatialVector); }
private static void throwNotEqualAssertionError(String messagePrefix, SpatialVectorReadOnly expected, SpatialVectorReadOnly actual, String format) { String expectedAsString = getSpatialVectorString(format, expected); String actualAsString = getSpatialVectorString(format, actual); throwNotEqualAssertionError(messagePrefix, expectedAsString, actualAsString, Double.toString(computeNormError(expected, actual))); }
/** * Gets a representative {@code String} of {@code spatialVector} given a specific format to use. * <p> * Using the default format {@link #DEFAULT_FORMAT}, this provides a {@code String} as follows: * * <pre> * Spatial Vector: [angular = ( 0.174, 0.732, -0.222 ), linear = ( 0.174, 0.732, -0.222 )] - expressedInFrame * </pre> * </p> * * @param format the format to use for each number. * @param spatialVector the object to get the {@code String} of. Not modified. * @return the representative {@code String}. */ public static String getSpatialVectorString(String format, SpatialVectorReadOnly spatialVector) { if (spatialVector == null) return "null"; else return getSpatialVectorString(format, spatialVector.getReferenceFrame(), spatialVector.getAngularPart(), spatialVector.getLinearPart()); }