Solved

A simple question

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
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…
The goal of this video is to provide viewers with basic examples to understand recursion 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.

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now