Ship A is 18.5km from a port P on a beearing of 045 degree and ship B is 26.4km from point P on a bearing of 105 degree. Calculate the bearing of A from B and the distance AB.

If P is (0,0)

A is at (13,13)
B is at (25.5,-6.83)

A-B = (-12.5,19.83)
bearing is 327.77°
AB = √(12.5^2 + 19.83^2) = 23.44

To calculate the bearing of A from B, we can use trigonometry and the Law of Cosines.

Step 1: Draw a diagram representing the given information. Place the port P at the center, and label the distances AP = 18.5 km and BP = 26.4 km.

Step 2: Calculate the angles at the port P by adding or subtracting the given bearings from 90 degrees. For ship A, the angle is 90 - 45 = 45 degrees. For ship B, the angle is 90 + 105 = 195 degrees.

Step 3: Use the Law of Cosines to find the distance AB. The law states that for any triangle, the square of one side is equal to the sum of the squares of the other two sides, minus twice the product of the other two sides and the cosine of the included angle.

In this case, we can use the following formula:
AB^2 = AP^2 + BP^2 - 2 * AP * BP * cos(angle between AP and BP)

Plugging in the values:
AB^2 = 18.5^2 + 26.4^2 - 2 * 18.5 * 26.4 * cos(195 degrees)

Step 4: Calculate AB by taking the square root of both sides of the equation.

AB = √(18.5^2 + 26.4^2 - 2 * 18.5 * 26.4 * cos(195 degrees))

Step 5: Calculate the bearing of A from B by using the trigonometric functions sine and cosine.

We can use the following formula:
cos(bearing of A from B) = (BP^2 + AB^2 - AP^2) / (2 * BP * AB)

Plugging in the values:
cos(bearing of A from B) = (26.4^2 + AB^2 - 18.5^2) / (2 * 26.4 * AB)

Step 6: Calculate the bearing of A from B by taking the inverse cosine of both sides of the equation.

bearing of A from B = arccos[(26.4^2 + AB^2 - 18.5^2) / (2 * 26.4 * AB)]

Now, you can plug in the values to calculate the distance AB and the bearing of A from B.

To solve this problem, we will use the concept of trigonometry and vector addition. Let's break it down step by step:

Step 1: Determine the position of Ship A and Ship B with respect to the port P.
- Ship A is 18.5 km away from port P on a bearing of 045 degrees.
- Ship B is 26.4 km away from port P on a bearing of 105 degrees.

Step 2: Calculate the coordinates of Ship A and Ship B.
- Assume port P as the origin (0,0). The x-axis represents east, and the y-axis represents north.
- Using trigonometry, we can find the x and y coordinates of Ship A and Ship B.

Coordinates of Ship A (Ax, Ay):
- Ax = 18.5 km * sin(45 degrees) = 18.5 km * √2/2 ≈ 13.07 km (east)
- Ay = 18.5 km * cos(45 degrees) = 18.5 km * √2/2 ≈ 13.07 km (north)

Coordinates of Ship B (Bx, By):
- Bx = 26.4 km * sin(105 degrees) = 26.4 km * √2/2 ≈ 18.67 km (east)
- By = 26.4 km * cos(105 degrees) = -26.4 km * √2/2 ≈ -18.67 km (south)

Step 3: Use the coordinates of Ship A and Ship B to calculate the vector AB.
- Vector AB is the difference between the coordinates of Ship B and Ship A.
- ABx = Bx - Ax = 18.67 km - 13.07 km = 5.6 km (east)
- ABy = By - Ay = -18.67 km - 13.07 km = -31.74 km (south)

Step 4: Calculate the bearing of A from B.
- The bearing from B to A is the angle between the positive x-axis and vector AB.
- tan(bearing) = ABy / ABx
- bearing = arctan(ABy / ABx)
- bearing ≈ arctan(-31.74 km / 5.6 km) ≈ -81.69 degrees

Note: The negative value indicates that the bearing is measured clockwise from the positive x-axis in the south direction.

Step 5: Calculate the distance AB.
- The distance between A and B is given by the magnitude of vector AB.
- distance AB = √(ABx^2 + ABy^2)
- distance AB ≈ √((5.6 km)^2 + (-31.74 km)^2) ≈ 32.88 km

So, the bearing of A from B is approximately -81.69 degrees, and the distance AB is approximately 32.88 km.