Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in C language 2. [15 marks] A student wants to develop a program that will help solve various physics problems. Create a library of functions

in C language
image text in transcribed
2. [15 marks] A student wants to develop a program that will help solve various physics problems. Create a library of functions (header file and source file) that can be used to calculate the following quantities: a) Sin - a function that returns the sine of an angle o given in degrees, b) Momentum - functions that returns the x and y components of the momentum of an object, given the mass and velocity (magnitude and angle in degrees). c) Kinetic Energy - a function that returns the kinetic energy of an object, given the mass and speed. d) Gravitational potential - a function that returns the gravitational potential energy of an object, given the mass and height above the ground. The standard C library, math.h, already contains the functions for sin, cos and tan, however, these functions require the angle to be given in radians, double sin (double x), where x is the angle in radians. You are allowed to use these functions from the math.h library to help define your degree-based trigonometric functions. Make sure you use function and variable names that enhance readability. Remember to add any necessary #include directives. Add comments to describe your files and functions. Try to create efficient code. Note, your file should NOT have any printf() or main() in your source code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions