Write a c function called bspline that takes as input a


Question: Please solve. We use C and visual studio

Part (a) Write a C function called Bspline that takes as input a single double precision argument called x. The function returns a double precision value y determined as given

if -2 <=x<0 then y=(1/4)(x+2)^3

if -1 <=x<0 then y=(1/4)+(3/4)(x+1)+(3/4)(x+1)^2 -(3/4)(x+1)^3

if 0 <=x<1 then y=(1/4)+(3/4)(x-1)+(3/4)(1-x)^2 -(3/4)(1-x)^3

if 1 <=x<=2 then y=(1/4)(2-3)^3

For all other input values, the function returns 0.0.

You have to provide a table of test results for 30 values of x, uniformly spaced between -2.25 and 2.25 inclusive

Part (b) Write a C function called shiftBspline that uses the function Bspline of Problem (a). This function takes a double precision argument called shift, and a double presision argument called x.

The function returns the value at location x of the Bspline function with its centre x-value shifted to the location shift.

Provide a table of 20 values of the shifted Bspline with the value of 10 for shift, and the table values uniformly spaced between shift -3.0 and shift +3.0. 

You need to write a function to shiftBspline and Bspline. Can someone please help me. I don't know what to do to write this C program and visual studio.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Write a c function called bspline that takes as input a
Reference No:- TGS0960577

Expected delivery within 24 Hours