Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The true bearing from a point A to a point B is the angle measured in degrees, i

ID: 3774870 • Letter: T

Question

The true bearing from a point A to a point B is the angle measured in degrees, in a clockwise direction, from the line joining the true north and point A to the line joining point A and point B.

The magnetic bearing from a point A to a point B is the angle measured in degrees, in a clockwise direction, from the line joining the magnetic north and point A to the line joining point A and point B.

The magnetic declination of a point A is the angle between the line joining point A to the true north and the line joining point A and the magnetic north.

Note: Magnetic declination is positive for easterly declinations, and negative for westerly declinations.

The formulas to find the true bearing of a point B from point A are:

x = sin((longitudeB – longitudeA) Radians)

y = cos(latitudeARadians)*tan(latitudeBRadians) - sin(latitudeARadians)*cos((longitudeB – longitudeA) Radians)

radians = tan-1(x/y);

AngleInDegrees = radiansToDegrees(radians);

Depending on the signs of x and y, the true bearing angle   AngleInDegrees computed above is normalized as:

If x = 0 and y > 0 and MagneticDeclination > 0: AngleInDegrees = AngleInDegrees + 360

If x = 0 and y < 0:    AngleInDegrees = AngleInDegrees + 180

If x > 0 and y < 0:     AngleInDegrees = AngleInDegrees + 180

If x < 0 and y < 0:     AngleInDegrees = AngleInDegrees + 180

If x < 0 and y > 0:     AngleInDegrees = AngleInDegrees + 360

To find the magnetic bearing (or direction) of a point B from a point A, use the following formula:

          MagneticBearing = NormalizedTrueBearing - MagneticDeclination

Write a C program that prompts for and reads the number N of cities or locations to be processed. It then loops N times to prompt for and read, for each location, the decimal latitude, decimal longitude, and decimal magnetic declination. It then computes and displays, for each location, the Qibla direction (or bearing) from Magnetic North.

Note:

Latitude of Al-Kaabah is 21.422506 and its longitude is 39.826203 [use point B as Al-Kaabah in the above formulas]

N can have values from 1 to 10 inclusive, i.e, -1 N 10

A decimal latitude can have values from -90 degrees to 90 degrees inclusive, i.e, -90 degrees 90

A decimal longitude can have values from -180 degrees to 180 degrees inclusive, i.e., -180 degrees 180

A decimal magnetic declination can have values from -180 degrees to 180 degrees inclusive, i.e., -180 degrees 180

The location of point A must be different from that of point B.

Your program must recover from input errors in a manner indicated in the sample program run below.

Your program must use appropriate constants and use the value 3.141592653589793238462643383279 for PI

In addition to the main function, your program must use three other appropriate functions to do the computations and conversions. Each of these other functions must not contain calls to scanf and printf.

Explanation / Answer

1. To purpose some thing to rebound from something: She bounced the tennis ball off the wall.
2. To rebound from something or a person: The basketball hit the rim and bounced off.
3. to provide a few concept or concept to someone for comment or approval: i've been considering what we ought to do subsequent, so permit me jump some thoughts off you.