104k views
4 votes
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 java

1 Answer

5 votes

by definition, a rectangle contains 90° angles so you can use the Pythagorean Theorem to find the length of the diagonal.

Diagonal(D)² = Length (L)² + width (w)²

D =
\sqrt{L^(2)+ w^(2) }

User BernieB
by
5.6k points