Here you can find the source of crossMult(int value, int maximum, int coefficient)
Parameter | Description |
---|---|
value | The value |
maximum | The maximum value |
coefficient | The coefficient |
public static int crossMult(int value, int maximum, int coefficient)
//package com.java2s; /*/*from w w w.j ava 2 s . c o m*/ * Copyright ? 2016 Cl?ment "w67clement" Wagner * * This file is part of OpenW67Render. * * OpenW67Render is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * OpenW67Render is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with OpenW67Render. If not, see <http://www.gnu.org/licenses/>. */ public class Main { /** * Do a cross multiplication * * @param value The value * @param maximum The maximum value * @param coefficient The coefficient * * @return The result */ public static int crossMult(int value, int maximum, int coefficient) { return (int) ((double) value / (double) maximum * (double) coefficient); } }