V
V
vitya_brodov2020-11-24 15:19:35
Java
vitya_brodov, 2020-11-24 15:19:35

How to solve this equation in java?

Hello! there is an equation:
5fbcf9e5d8dc8460655686.png
In general, I have no idea how to solve it, but I did it like this:

public static void main(String[] args) {
        double x;
        double y;
        Scanner scan = new Scanner(System.in);
        System.out.println("Введите х:");
        double user = scan.nextDouble();
        if(user > 0){
           double a =  Math.sin(2) * user;
            System.out.println(a);
        }
        else {
            double b = 1 - 2 * Math.sin(Math.pow(user,2));
        }


Question: Am I doing everything right or not? if not, what should be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sand, 2020-11-24
@vitya_brodov

Math.pow(Math.sin(user), 2) // (sinX)^2
Math.sin(Math.pow(user, 2)) // sin(X^2)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question