└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # field-length-measurement 2 | import math 3 | 4 | def calculate_field_length(area, width): 5 | """Calculate the length of a field given its area and width.""" 6 | if width <= 0: 7 | return "Width must be greater than zero!" 8 | return area / width 9 | 10 | def calculate_field_diagonal(length, width): 11 | """Calculate the diagonal of a rectangular field.""" 12 | return math.sqrt(length**2 + width**2) 13 | 14 | # Example usage 15 | area = 5000 # Square meters 16 | width = 50 # Meters 17 | length = calculate_field_length(area, width) 18 | diagonal = calculate_field_diagonal(length, width) 19 | 20 | print(f"Field Length: {length} meters") 21 | print(f"Field Diagonal: {diagonal:.2f} meters") 22 | --------------------------------------------------------------------------------