
package pruebasmetodosmath;

import static java.lang.System.*;
import static java.lang.Math.*;

public class PruebasMetodosMath {

    public static void main(String[] args) {
        out.println("POTENCIA                                   pow(3,2):     "+pow(3,2));
        out.println("RAIZ CUADRADA                              sqrt(144):    "+sqrt(144));
        System.out.println("LOGARITMO DECIMAL                          Math.log10(10000)  "+log10(10000));       
        System.out.println("El número E elevado al valor proporcionado Math.exp(3):       "+Math.exp(3));
        System.out.println("LOGARITMO NEPERIANO   Math.log(20.085536923187668)            "+Math.log(20.085536923187668));       
        System.out.println("VALOR de E:     "+Math.E);
        System.out.println("NUMERO ALEATORIO                      Math.random()     "+Math.random());
        // Para la generación de números aleatorios, también se puede recurrir a la clase Random      
        out.println("VALOR ABSOLUTO                        abs(-15):    "+abs(-15));
        out.println("REDONDEO AL ENTERO MENOR MAS PROXIMO  floor(53.8): "+floor(53.8));
        out.println("REDONDEO AL ENTERO MAYOR MAS PROXIMO  ceil(53.8):  "+ceil(53.8));
        System.out.println("REDONDEO AL ENTERO MAS PROXIMO        Math.round(53.2): "+Math.round(53.2));       
        System.out.println("REDONDEO AL ENTERO MAS PROXIMO        Math.round(53.8): "+Math.round(53.8));
        System.out.println("REDONDEO AL DOUBLE MAS PROXIMO        Math.rint(53.2):  "+Math.rint(53.2));       
        System.out.println("REDONDEO AL DOUBLE MAS PROXIMO        Math.rint(53.8):  "+Math.rint(53.8));
        System.out.println("VALOR MAXIMO   Math.max(15,70):     "+Math.max(15,70));
        System.out.println("VALOR MINIMO   Math.min(15,70):     "+Math.min(15,70));        
        System.out.println("VALOR de PI:     "+Math.PI);
        System.out.println("CONVERSION DE GRADOS SEXAGESIMALES A RADIANES   Math.toRadians(90):                 "+Math.toRadians(90));
        System.out.println("CONVERSION DE RADIANES A GRADOS SEXAGESIMALES   Math.toDegrees(1.5707963267948966): "+Math.toDegrees(1.5707963267948966));
        // En la obtención de funciones trigonométricas, el parámetro se aporta expresado en radianes
        System.out.println("SENO            Math.sin(Math.toRadians(90)):                   "+Math.sin(Math.toRadians(90)));
        System.out.println("ARCO SENO       Math.toDegrees(Math.asin(1)):                   "+Math.toDegrees(Math.asin(1)));   
        System.out.println("COSENO          Math.cos(Math.toRadians(30)):                   "+Math.cos(Math.toRadians(30)));
        System.out.println("ARCO COSENO     Math.toDegrees(Math.acos(0.8660254037844387))): "+Math.toDegrees(Math.acos(0.8660254037844387)));
        System.out.println("TANGENTE        Math.tan(Math.toRadians(45)):                   "+Math.tan(Math.toRadians(45)));
        System.out.println("ARCO TANGENTE   Math.toDegrees(Math.atan(1)):                   "+Math.toDegrees(Math.atan(1)));
    }
}
