Solved

A simple question

Posted on 2000-02-15
4
205 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 10 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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
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 for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

829 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