Java Graphics Rotate rotate(AffineTransform transform, float angleInDegrees)

Here you can find the source of rotate(AffineTransform transform, float angleInDegrees)

Description

rotate the given transform

License

Apache License

Parameter

Parameter Description
angleInDegrees a parameter

Declaration

public static void rotate(AffineTransform transform, float angleInDegrees) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.awt.geom.AffineTransform;

public class Main {
    /**/*from   w  ww  .ja v  a  2 s .c o  m*/
     * rotate the given transform
     * 
     * @param angleInDegrees
     */
    public static void rotate(AffineTransform transform, float angleInDegrees) {
        if (transform != null) {
            // the awt rotate requires radians so we need to convert
            // from degrees to radians
            double angleInRadians = angleInDegrees * (Math.PI / 180);
            transform.rotate(angleInRadians);
        }
    }
}

Related

  1. rotate(byte[] bytes)
  2. rotate(Dimension rect)
  3. rotate(final Point2D pos, final Point2D center, final double dist)
  4. rotate(final Point2D vec, final double theta)