Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Mathematica Question plz help Part 2 Color interpolation -- Create two colors, coloro and colori. These are the color endpoints. They may not be white

Mathematica Question plz helpimage text in transcribedimage text in transcribedimage text in transcribed

Part 2 Color interpolation -- Create two colors, coloro and colori. These are the color endpoints. They may not be white or black. -- Complete the function colorInterpolation that interpolates between the color endpoints, returning a new color. The input to this function is theta in (parmStart, parmEnd) and the color endpoints. -- Create a Graphics plot of 11 Disks, each with a color generated from colorlnterpolation. The first circle should be coloro and the last colori. -- Follow the detailed instruction in the "TO DO" below. (* TO DO *) (* start and end color in {red, green, blue} format *) coloro = {0.0, 0.0, 0.0}; color1 = {0.0, 0.0, 0.0}; (* TO DO *) (* interpolate color using global coordinate theta. input: coloro, color i (as global variables) and theta in [paramstart, paramEnd] Use globalToLocal function to create local variable t in [0,1]. output: color. colorInterpolation[theta_] := ( color = {0, 0, 0} ); (* TO DO *) (* create a Table of 11 testcolors by calling color Interpolation *) delta = paramEnd - paramstart; (* testcolors = Table[ .. *) (* TO DO *) (* Leave these print statements here. Uncomment out when ready to test *) (* 1gthTestcolors = Length[testcolors]; Print["Length of testcolors = ", lgthTestcolors]; Print["coloro = ", coloro," testcolors [[1]] = ", testcolors[[1]]]; Print["color1 = ",colori," testcolors [[last]] = ", testcolors [[lgthTestcolors]]]; (* TO DO *) (* create a table of disks and show them. Tip: Use RGB Color[color] to set the color of a disk to color = {r, g, b} *) circlesPlot = Table [Graphics [... Show [circlesplot] *) Part 2 Color interpolation -- Create two colors, coloro and colori. These are the color endpoints. They may not be white or black. -- Complete the function colorInterpolation that interpolates between the color endpoints, returning a new color. The input to this function is theta in (parmStart, parmEnd) and the color endpoints. -- Create a Graphics plot of 11 Disks, each with a color generated from colorlnterpolation. The first circle should be coloro and the last colori. -- Follow the detailed instruction in the "TO DO" below. (* TO DO *) (* start and end color in {red, green, blue} format *) coloro = {0.0, 0.0, 0.0}; color1 = {0.0, 0.0, 0.0}; (* TO DO *) (* interpolate color using global coordinate theta. input: coloro, color i (as global variables) and theta in [paramstart, paramEnd] Use globalToLocal function to create local variable t in [0,1]. output: color. colorInterpolation[theta_] := ( color = {0, 0, 0} ); (* TO DO *) (* create a Table of 11 testcolors by calling color Interpolation *) delta = paramEnd - paramstart; (* testcolors = Table[ .. *) (* TO DO *) (* Leave these print statements here. Uncomment out when ready to test *) (* 1gthTestcolors = Length[testcolors]; Print["Length of testcolors = ", lgthTestcolors]; Print["coloro = ", coloro," testcolors [[1]] = ", testcolors[[1]]]; Print["color1 = ",colori," testcolors [[last]] = ", testcolors [[lgthTestcolors]]]; (* TO DO *) (* create a table of disks and show them. Tip: Use RGB Color[color] to set the color of a disk to color = {r, g, b} *) circlesPlot = Table [Graphics [... Show [circlesplot] *)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Classify delivery styles by type.

Answered: 1 week ago