Package pl.poznan.put.circular.enums
Enum AngleTransformation
- java.lang.Object
-
- java.lang.Enum<AngleTransformation>
-
- pl.poznan.put.circular.enums.AngleTransformation
-
- All Implemented Interfaces:
Serializable,Comparable<AngleTransformation>
public enum AngleTransformation extends Enum<AngleTransformation>
A transformation used to display circular diagrams.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description doubletransform(double radians)Transforms an angle value in radians to represent it on circle.static AngleTransformationvalueOf(String name)Returns the enum constant of this type with the specified name.static AngleTransformation[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CLOCK
public static final AngleTransformation CLOCK
0 degree is on top, 90 degree is on the right.
-
MATH
public static final AngleTransformation MATH
0 degree is on the right, 90 degree is on top.
-
-
Method Detail
-
values
public static AngleTransformation[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (AngleTransformation c : AngleTransformation.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AngleTransformation valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
transform
public double transform(double radians)
Transforms an angle value in radians to represent it on circle. InMATHthe value is returned as it is, so value 0 is on X-axis and increasing values are drawn counter-clockwise. InCLOCKthe value is transformed such that 0 is at the top of the circle and the increasing values are drawn clockwise.- Parameters:
radians- Value in radians to be transformed.- Returns:
- A transformed value in radians to be drawn on a circle.
-
-