private float ScaleVector(int length, float position) { float value = (((((float)length) / 1f) / 2f) * position) + (length / 2); if (value > length) { return (float)length; } if (value < 0f) { return 0f; } return value; }