Question: I need a method that takes as input a double between 0 and 1 8 0 and outputs a double between - 1 and 1

I need a method that takes as input a double between 0 and 180 and outputs a double between -1 and 1 with 0 mapping to -1 and 180 mapping to 1. Some of the versions below are buggy. Which is correct? You're expected to test out these methods. No input validation is needed:
Question 1 options:
public static double angleToInterval(double angle){
return -1- angle/90.0;
}
public static double angleToInterval(double angle){
return 1- angle/90.0;
}
public static double angleToInterval(double angle){
return angle/90.0-1;
}
public static double angleToInterval(double angle){
return angle/90.0+1;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!