if(!value)
throw new RuntimeException("assertTrue fails!");
}
public static void main(String[] args) throws Exception {
ModelStandardTransform transform = new ModelStandardTransform();
transform.setTransform(ModelStandardTransform.TRANSFORM_CONCAVE);
assertTrue(checkLinearity(transform));
transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX);
transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR);
assertTrue(Math.abs(transform.transform(0.0f) - 0.0f) < 0.0001f);
assertTrue(transform.transform(0.5f) < 0.5f);
assertTrue(Math.abs(transform.transform(1.0f) - 1.0f) < 0.0001f);
transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN);
transform.setPolarity(ModelStandardTransform.POLARITY_UNIPOLAR);
assertTrue(Math.abs(transform.transform(1.0f) - 0.0f) < 0.0001f);
assertTrue(transform.transform(0.5f) < 0.5f);
assertTrue(Math.abs(transform.transform(0.0f) - 1.0f) < 0.0001f);
transform.setDirection(ModelStandardTransform.DIRECTION_MIN2MAX);
transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR);
assertTrue(Math.abs(transform.transform(0.0f) + 1.0f) < 0.0001f);
assertTrue(transform.transform(0.25f) > -0.5f);
assertTrue(Math.abs(transform.transform(0.5f) - 0.0f) < 0.0001f);
assertTrue(transform.transform(0.75f) < 0.5f);
assertTrue(Math.abs(transform.transform(1.0f) - 1.0f) < 0.0001f);
transform.setDirection(ModelStandardTransform.DIRECTION_MAX2MIN);
transform.setPolarity(ModelStandardTransform.POLARITY_BIPOLAR);
assertTrue(Math.abs(transform.transform(1.0f) + 1.0f) < 0.0001f);
assertTrue(transform.transform(0.75f) > -0.5f);
assertTrue(Math.abs(transform.transform(0.50f) - 0.0f) < 0.0001f);
assertTrue(transform.transform(0.25f) < 0.5f);
assertTrue(Math.abs(transform.transform(0.0f) - 1.0f) < 0.0001f);
}