Προς το περιεχόμενο

sin(x) και approximation σε C


Aggeluska

Προτεινόμενες αναρτήσεις

καλησπερα παιδια εχω το εξης ερωτημα . θελω να φτιαξω ενα προγραμμα που να υπολογιζει το Sin(x) , οκ αυτο μπορω να το κανω. μετα ομως μου βαζει καποια υποερωτηματα οπως αυτο με τον interval και το approximation.

 

edit: δεν με αφηνει να ανεβασω τα φανκτιονς ..... αν γκουγκλαρετε θα τα βρειτε

 

εχω κανει επισυναψη τα fuction .

 

The sine function can be approximated by a power series as follows:

 

 

 

Write a C program consisting of main() . Inside main, use a statement or a sequence of

statements in order to calculate sin(x) of a double value dvalue.

As a second step, write a function double sin_IE1(double x) which approximates sin(x)

for a given value x.

Note:

. First, shift the argument x by adding or subtracting 2π τo interval [.-π ,π ].

. Calculate the approximated value of sin(x) up to a precision of 10-9, i.e. until the last

element of the sum contributes less than 10-9.

In a similar way, the exponential function can be approximated by a power series as follows:

 

 

 

Write a function double exp_IE1(double x), which approximates exp(x) for a given

value x.

Note that the denominator k! (factorial ) can become very large, even if k is rather small. In

this case the result will be wrong. Check this, stop the calculation and display an error

message if this happens.

In addition, write a main program, which allows to test the functions:

Input: real number (double)

Συνδέστε για να σχολιάσετε
Κοινοποίηση σε άλλες σελίδες

Δημιουργήστε ένα λογαριασμό ή συνδεθείτε για να σχολιάσετε

Πρέπει να είστε μέλος για να αφήσετε σχόλιο

Δημιουργία λογαριασμού

Εγγραφείτε με νέο λογαριασμό στην κοινότητα μας. Είναι πανεύκολο!

Δημιουργία νέου λογαριασμού

Σύνδεση

Έχετε ήδη λογαριασμό; Συνδεθείτε εδώ.

Συνδεθείτε τώρα
  • Δημιουργία νέου...