EECE1080C/CS1021C Lab Functions 2 Topics covered: C++ Program Development Practice, Loops, Functions and Arrays B. Taylor Series Use filename: TayLor.cpp Background - You should know from your calculus classes that any well- behaved function can be represented as an infinite series known as a Taylor Series (see: https://www.mathsisfun.com/algebra/taylor-series.html).The focus of this lab element is to compute trigonometric function values for sin and cos by explicitly using their (truncated) Taylor (actually, McLaurin) Series representations. These are given by sin(x) = x - x³/3! + x°/5! - x'/7!... cos(x) = 1 - x²/2! + x*/4! - x*/6!... %3D Notice that sin(x) has odd exponent values and cos(x) has even exponent values. Later on, in your math classes you will learn about odd and even functions and their properties. sin is an odd function and cos is an even function. When you call a math function in your code, say, for example, log10(), your computer actually gets the result by constructing and evaluating a truncated Taylor Series for the function. This lab element requires the development of several functions. Prototypes and a brief description are given in the following. • int factorial(const int &); - use function from Part A double degreesTORadians(const double &); - As the name implies, this function converts the angle value which is input with units of degrees to radians. Recall, radians = degrees(7/180.) • double mySine(const double &, int, double 8); - This function takes 3 arguments and returns a type double value. The return value and arguments are: o [return type double] - the function returns the truncated Taylor Series sum which is the evaluation of sin(x), where x is the first argument (see the following) o const double &x - angle value in radians int i - position of term in Taylor series that is to be assigned to next argument double &result ith term (2nd argument) in truncated Taylor Series for
EECE1080C/CS1021C Lab Functions 2 Topics covered: C++ Program Development Practice, Loops, Functions and Arrays B. Taylor Series Use filename: TayLor.cpp Background - You should know from your calculus classes that any well- behaved function can be represented as an infinite series known as a Taylor Series (see: https://www.mathsisfun.com/algebra/taylor-series.html).The focus of this lab element is to compute trigonometric function values for sin and cos by explicitly using their (truncated) Taylor (actually, McLaurin) Series representations. These are given by sin(x) = x - x³/3! + x°/5! - x'/7!... cos(x) = 1 - x²/2! + x*/4! - x*/6!... %3D Notice that sin(x) has odd exponent values and cos(x) has even exponent values. Later on, in your math classes you will learn about odd and even functions and their properties. sin is an odd function and cos is an even function. When you call a math function in your code, say, for example, log10(), your computer actually gets the result by constructing and evaluating a truncated Taylor Series for the function. This lab element requires the development of several functions. Prototypes and a brief description are given in the following. • int factorial(const int &); - use function from Part A double degreesTORadians(const double &); - As the name implies, this function converts the angle value which is input with units of degrees to radians. Recall, radians = degrees(7/180.) • double mySine(const double &, int, double 8); - This function takes 3 arguments and returns a type double value. The return value and arguments are: o [return type double] - the function returns the truncated Taylor Series sum which is the evaluation of sin(x), where x is the first argument (see the following) o const double &x - angle value in radians int i - position of term in Taylor series that is to be assigned to next argument double &result ith term (2nd argument) in truncated Taylor Series for
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
100%
C++
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY