140 likes | 253 Views
Chapter 3: Math Functions. Adapted from Problem Solving & Program Design in C Sixth Edition By Jeri R. Hanly & Elliot B. Koffman. Figure 3.2 Outline of Program Circle. Figure 3.3 Calculating the Area and the Circumference of a Circle.
E N D
Chapter 3:Math Functions Adapted from Problem Solving & Program Design in C Sixth Edition By Jeri R. Hanly & Elliot B. Koffman
Figure 3.3 Calculating the Area and the Circumference of a Circle
Figure 3.3 Calculating the Area and the Circumference of a Circle (cont’d)
Example Formula to calculate unknown side “a” of a triangle a2=b2 + c2 – 2bc cosα
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));