# Adapted from Pearson Addison-Wesley. Addison Wesley is an imprint of Chapter 3: Math Functions Adapted from Problem Solving & Program Design in C Sixth.

## Presentation on theme: "Adapted from Pearson Addison-Wesley. Addison Wesley is an imprint of Chapter 3: Math Functions Adapted from Problem Solving & Program Design in C Sixth."— Presentation transcript:

Adapted from Pearson Addison-Wesley. Addison Wesley is an imprint of Chapter 3: Math Functions Adapted from Problem Solving & Program Design in C Sixth Edition By Jeri R. Hanly & Elliot B. Koffman

1-3 © 2010 Pearson Addison-Wesley. All rights reserved. 1-3 Figure 3.3 Calculating the Area and the Circumference of a Circle

1-4 © 2010 Pearson Addison-Wesley. All rights reserved. 1-4 Figure 3.3 Calculating the Area and the Circumference of a Circle (cont’d)

1-5 © 2010 Pearson Addison-Wesley. All rights reserved. 1-5 Figure 3.4 Computing the Rim Area of a Flat Washer

1-8 © 2010 Pearson Addison-Wesley. All rights reserved. 1-8 Figure 3.6 Function sqrt as a “Black Box”

1-11 © 2010 Pearson Addison-Wesley. All rights reserved. 1-11 Common Mathematical Library Functions Function Standard header fileArgument(s) Result abs(x)stdlib.hint fabs(x)math.hdouble ceil(x)math.hdouble floor(x)math.hdouble cos(x), sin(x) and tan(x) math.hdouble

1-12 © 2010 Pearson Addison-Wesley. All rights reserved. 1-12 Common Mathematical Library Functions Function Standard header fileArgument(s) Result exp(x)math.hdouble log(x)math.hdouble log10(x)math.hdouble pow(x, y)math.hdouble, double double sqrt(x)math.hdouble

1-13 © 2010 Pearson Addison-Wesley. All rights reserved. 1-13 Example Formula to calculate unknown side “a” of a triangle a 2 =b 2 + c 2 – 2bc cosα

1-14 © 2010 Pearson Addison-Wesley. All rights reserved. 1-14 Triangle with Unknown Side a After defining a, b, c, PI and alpha a = sqrt(pow(b,2) + pow (c,2) – 2*b*c* cos (alpha*PI /180.0));