Agustin G. answered 03/21/24
Tutor
5
(2)
Effective English Tutor Specializing in Reading and Test Prep Skills
import math
"""
You were on the right track in your attempt,
but you mistakenly used sine instead of cosine.
Remember, SOH CAH TOA! Sine gives you the opposite
side from the angle, while we are actually looking
for the adjacent side. Also, make sure you convert
the angle from degrees to radians before putting
it into a trig function!
"""
# Given data from the problem
distance = 80 # total distance in km
bearing = 48 # bearing in degrees
# Calculate the eastward distance
# Convert bearing angle from degrees to radians
bearing_radians = math.radians(bearing)
east_distance = distance * math.cos(bearing_radians)
print(f"The speed boat is {east_distance:.2f} km east of its \
starting point.")
"""
Running this code should give you the following output:
The speed boat is 53.53 km east of its starting point.
""";