Here you can find the source of integerToFloat(float f, int i, float offset, boolean rotate)
private static float integerToFloat(float f, int i, float offset, boolean rotate)
//package com.java2s; public class Main { private static float integerToFloat(float f, int i, float offset, boolean rotate) { if (rotate) { float v = f + i / (2 * offset); if (v < 0.0f) { return v + 1.0f; } else if (v > 1.0f) { return v - 1.0f; } else { return v; }/*from w w w . j ava 2 s. c o m*/ } else { if (i > 0) { return f + (1.0f - f) * i / offset; } else { return f + f * i / offset; } } } }