Write a c function called bspline

Assignment Help C/C++ Programming
Reference no: EM13707311

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.

Reference no: EM13707311

Questions Cloud

How many bytes wide should each write buffer entry : What speedup could be expected in the steady state by using a merging write buffer instead of a non-merging buffer when zeroing memory by the execution of 64 bit stores if all other instructions could be issued in parallel with the stores and the ..
External gates to realize the function : Use a 4-to-1 multiplexer and a minimum number of external gates to realize the function - The inputs are only available uncomplemented.
Indexed addressing to reverse the elements : Use a loop with indirect or indexed addressing to reverse the elements of the integer array in place - Can you implement a program to indexed addressing to reverse the elements of an array?
Explain about the data warehouses and relational databases : Can you explain about the Data Warehouses and relational databases?
Write a c function called bspline : 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
Implement the link list using java programming concepts : Modify the class LinkedList by adding to it the following methods. The appropriate error message should be generated if an invalid condition occurs.
Create a structure named dog with a string field : Create a Structure named dog with a string field for the Dog's name. Create a Structure named Cat with a string field for the Cat's name.
Prepare an overloaded constructor : Prepare an overloaded constructor that provides values for each field. Also provide get methods for each field. Save the file as Patient.java.
Establish shared-memory object between parent and child : the child process must output the sequence of numbers generated from the algorithm specified by the Collatz conjecture because the parent and child have their own copies of the data.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Class named realestate that has data members

Create a class named RealEstate that has data members to hold the price of a house, the number of bedrooms, and the number of baths. Member functions include overloaded insertion and extraction operations

  Your program should include two functions

Your program should include two functions. Function celsius_at_depth should compute and return the Celsius temperature at a depth given in kilometers. Function fahrenheit should convert a Celsius temperature to Fahrenheit.

  Create a program that outputs the result of the formula

Create a program that outputs the result of the formula f = (a - b)(x - y) using the printf() functions.

  Takes a string containing a full name

Write a program that takes a string containing a full name and outputs each part of the name separately with its length. The name should be in the form of first, middle, and last name, separated from each other by a single space. For example, if the ..

  Write a program that computes the total sales tax

Write a program that computes the total sales tax on a $52 purchase. Assume the state sales tax is 4 percent and the states sales tax is 4 percent and the country sales tax is 2 percent;

  Problem 1greatest common divisor write code for a recursive

problem 1greatest common divisor write code for a recursive implementation of euclids algorithm for searching the

  Smallest sequence of numbers in the array

Write a function called sum_smallest_sequence() that accepts an array of  signed  integers and the  number  of items in the array as arguments, and returns the sum of the smallest sequence of numbers in the array.

  Write a program to calculate the volume flow rate

Write a program to calculate the volume flow rate in cubic feet per second of water flowing through a pipe of diameter d in inches and a velocity of v feet per second.

  Write a program that gives a prompt to the users

Write a program that gives a prompt to the users, asking for an integer n. It then prints out a random permutation, on one line , of 1,2,.......n separated by spaces or lines.

  Write c program for linked list applications

Write a complete C program which illustrates the Linked list applications data structures and algorithms. The program will read in mid-semester test scores as Main Linked List and produce six outputs:

  The factorial of a positive integer n, denoted by n!

Write a program that computes the sequence of factorial values: 1! = 1, 2! = 2, 3! = 6, 4! = 24, 5! = 120, 6! = 720, ....

  Write a program that reads in babynames

Write a program that reads in babynames.txt and produces two files - Separate the data for the boys and girls. You may enter any names

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd