Question: Answer the following: Implement a function grapher. Essentially you must create a program that can plot a function that is in the form z =

Answer the following:
Implement a function grapher. Essentially you must create a program that can plot a function that is in the form z = f(x,y)
The program must generate input values between -1 and 1 in increments of .1 and use this to plot x, y, and z vertices to be included as part of a mesh that will then be graphically displayed.
Implement the functionality to allow both the function to be mapped as expressed as a mathematical formula and the input values to be entered by the user of your program
The program must implement mouse controls such that the function that you have mapped can be rotated and scaled using the mouse.
The project MUST include a plane and an axis helper to provide a point of reference for your function that indicates the origin which is assumed to be x=0, y=0, and z=0.
The axis helper is an object that can be added to you scene that looks like the following and indicates the direction of x, y, and z within the scene.
Your completed project should look like the following example
In the above example we are graphing the function z = f(x,y) where f(x,y)= x2+ y2. Your function grapher should be able to accommodate any function that can be expressed and evaluated as a mathematical function. In the case of the above example the input values of x and y are evaluated to produce a value of z producing the coordinates for a vertex. Although your program should be able to graph any function in the form z = f(x,y), you should use one of the following to submit as part of the assignment:
produces a cone shape
produces a hyperbolic paraboloid
The input values can be generated using simple for loops as indicated below or by using one of the other examples that have been identified.
for (x=Min_x; x=Max_x; x+=.01)
{
for(y=Min_y; y=Max_y; y+=.01)
{
z = fun(x,y); // note that fun must evaluate the expression
new Vector3(....);
}
}
Keep in mind that you must capture all of the vertices that you are defining and provide them as input into one of the geometry functions within Three.js. The ParametricGeometry object is perhaps the best one to use, however, if your research identifies another approach feel free to use it so long as you can achieve the same results.
Note:
It is essential to document your code liberally with comments to ensure that a reviewer understands what you were attempting to do within the assignment.
Submit the JavaScript code.
Answer the following: Implement a function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!