19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 4980035
27 * @summary Unit test for new methods:
28 *
29 * AffineTransform.getRotateInstance(double x, double y);
30 * AffineTransform.setToRotation(double x, double y);
31 * AffineTransform.rotate(double x, double y);
32 *
33 * AffineTransform.getQuadrantRotateInstance(int numquads);
34 * AffineTransform.setToQuadrantRotation(int numquads);
35 * AffineTransform.quadrantRotate(int numquads);
36 *
37 * @author flar
38 * @run main TestRotateMethods
39 */
40
41 import java.awt.geom.AffineTransform;
42 import java.awt.geom.Point2D;
43
44 public class TestRotateMethods {
45 /* The maximum errors allowed, measured in double precision "ulps"
46 * Note that for most fields, the tests are extremely accurate - to
47 * within 3 ulps of the smaller value in the comparison
48 * For the translation components, the tests are still very accurate,
49 * but the absolute number of ulps can be noticeably higher when we
50 * use one of the rotate methods that takes an anchor point.
51 * Since a double precision value has 56 bits of precision, even
52 * 1024 ulps is extremely small as a ratio of the value.
53 */
54 public static final double MAX_ULPS = 3.0;
55 public static final double MAX_ANCHOR_TX_ULPS = 1024.0;
56 public static double MAX_TX_ULPS = MAX_ULPS;
57
58 // Vectors for quadrant rotations
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 4980035
27 * @summary Unit test for new methods:
28 *
29 * AffineTransform.getRotateInstance(double x, double y);
30 * AffineTransform.setToRotation(double x, double y);
31 * AffineTransform.rotate(double x, double y);
32 *
33 * AffineTransform.getQuadrantRotateInstance(int numquads);
34 * AffineTransform.setToQuadrantRotation(int numquads);
35 * AffineTransform.quadrantRotate(int numquads);
36 *
37 * @author flar
38 * @run main TestRotateMethods
39 * @key randomness
40 */
41
42 import java.awt.geom.AffineTransform;
43 import java.awt.geom.Point2D;
44
45 public class TestRotateMethods {
46 /* The maximum errors allowed, measured in double precision "ulps"
47 * Note that for most fields, the tests are extremely accurate - to
48 * within 3 ulps of the smaller value in the comparison
49 * For the translation components, the tests are still very accurate,
50 * but the absolute number of ulps can be noticeably higher when we
51 * use one of the rotate methods that takes an anchor point.
52 * Since a double precision value has 56 bits of precision, even
53 * 1024 ulps is extremely small as a ratio of the value.
54 */
55 public static final double MAX_ULPS = 3.0;
56 public static final double MAX_ANCHOR_TX_ULPS = 1024.0;
57 public static double MAX_TX_ULPS = MAX_ULPS;
58
59 // Vectors for quadrant rotations
|