Message Boards Message Boards

0
|
6765 Views
|
4 Replies
|
1 Total Likes
View groups...
Share
Share this post:

[EIWL] Solving problems in Chapter 7 of EIWL Book by Stephen Wolfram

Posted 8 years ago

Hi all.

This thread is for getting help with any and all problems in Chapter 7, using functions from previous chapters only. It is for people who are learning Mathematica and working their way through the book.

I am stuck on question 7.7 Make a list of colors obtained by blending yellow with hues from 0 to 1 in steps of 0.05.. Blend[{Yellow, Hue[{0, 1, 0.05}]}] doesn't work, and I am pretty sure I need to wrap it all in Table, this didn't work either:

Table[Blend[{Yellow, Hue[{0, 1, 0.05}]}], 20] . 

20 was arbitrary, and is wrong - the list should automatically fill up to a natural limit, without needing the limit to be hard coded.

Thanks in advance for any help. :)

POSTED BY: D P
4 Replies
Posted 8 years ago

Hey, I just found the complete solutions to all the questions in the book!

https://www.wolfram.com/language/elementary-introduction/answers-to-exercises.html

POSTED BY: D P
Posted 8 years ago

Now I am stuck on 7.8.

enter image description here

Table[{Range[x], Hue[x]}, {x, 0, 1, 0.1}] gets the right hues, but there are no numbers. Table[Range[x], {Hue[x], {x, 0, 1, 0.1}}] doesn't work. Table[Hue[Range[x]], {x, 0, 1, 0.1}] doesn't work.

POSTED BY: D P
Posted 8 years ago
(*Generates table of hues from 0 to 1 in steps of 1/20*)
Table[
 Hue[x], {x, 0, 1, 1/20}]
(*Blends yellow with each hue in table*)
Table[
 Blend[{Yellow, Hue[x]}], {x, 0, 1, 1/20}]
(*Example code from blend documentation*)
Graphics[
 Table[{Blend[{Red, Blue}, x], Disk[{8 x, 0}]}, {x, 0, 1, 1/8}]]
(*Putting it all together*)
Graphics[
 Table[{Blend[{Yellow, Hue[x]}], Disk[{8 x, 0}]}, {x, 0, 1, 1/20}]]
POSTED BY: v z
Posted 8 years ago

V Z, thanks for your reply.

This is the solution(from your reply):

Table[ Blend[{Yellow, Hue[x]}], {x, 0, 1, 1/20}]
POSTED BY: D P
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract