JAVA help!!! simple expression?
The length of a rectangle is stored in a double variable named length , the width in one named width . Write an expression whose value is the length of the diagonal of the rectangle.
The length of a rectangle is stored in a double variable named length , the width in one named width . Write an expression whose value is the length of the diagonal of the rectangle.
modulo_function
Favorite Answer
The diagonal of a rectangle that's w wide and l long is:
double diag = Math.sqrt( w*w + l*l );
That's simply the Pythaogorean formula.