Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

A simple question

Posted on 2000-02-15
4
Medium Priority
?
223 Views
Last Modified: 2010-04-15
I have been asked to use the cephes math library to write a C program which will generate the values of the zeroth order Bessel function [j0(x)] for 50 values of x evenly spaced in the interval 0 < x < 10. But I am totally confuse about this question. What is that mean? Please help. Thanks !
0
Comment
Question by:clo1
  • 3
4 Comments
 
LVL 10

Accepted Solution

by:
rbr earned 40 total points
ID: 2526061
Assume that you have a function j0 which generates the bessel function.


Then you have to divide the interval (0,10) in 50 steps

int n=50;
double a=0,b=10,x;
for (i=1;i<=n;i++) {

    x=(b-a)*i/(n+1)+a;

    printf ("Bessel for x=%f:%f\n",x,j0(x));
}
0
 
LVL 10

Expert Comment

by:rbr
ID: 2526068
if you need the boundaries too (0<=x<=10) use
for (i=0;i<n;i++) {

x=(b-a)*i(n-1)+a;
0
 
LVL 10

Expert Comment

by:rbr
ID: 2526070
sorry
x=(b-a)*i/(n-1)+a;
0
 
LVL 2

Author Comment

by:clo1
ID: 2526124
Oic, I finally know what it means now. But I would like to know where do you get the information on how to use the bessel function?? Cause I have try to read the double.doc file in the cephes's doc directory, but no clue. Anway, Thanks very much !!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question