Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Task 3 - Color Functions
#1
Can anyone explain the math that's going on in these color functions? I am getting the correct number of iterations, r and s values from the resistance function but I am confused on how to compute the rbg values from the iteration number and the threshold number using a cosine/sin wave 'model'.
Reply
#2
Use the generalized form of sine (and cosine):

y = A sin(fx + d)

where A is the amplitude, f is the frequency, and d is the shift. For blue, as an example, you want the frequency to be such that from 0 to t-1 is one quarter of a cycle. You need to fiddle with pi and such to get the frequency right.
Reply
#3
(09-01-2017, 12:51 AM)lusth Wrote: Use the generalized form of sine (and cosine):

y = A sin(fx + d)

where A is the amplitude, f is the frequency, and d is the shift. For blue, as an example, you want the frequency to be such that from 0 to t-1 is one quarter of a cycle. You need to fiddle with pi and such to get the frequency right.
I am so lost figuring out the color function. Got the resistance working.
Reply
#4
(09-07-2017, 03:34 PM)mmrahman Wrote:
(09-01-2017, 12:51 AM)lusth Wrote: Use the generalized form of sine (and cosine):

y = A sin(fx + d)

where A is the amplitude, f is the frequency, and d is the shift. For blue, as an example, you want the frequency to be such that from 0 to t-1 is one quarter of a cycle. You need to fiddle with pi and such to get the frequency right.
I am so lost figuring out the color function. Got the resistance working.

[Image: ojCgjy8.png]
UA ACM Vice President
ACM has bi-weekly meetings Tuesdays at 5:15pm
We're UA's best organization for CS majors (website)
Join us on Slack for all kinds of discussion channels (including one for CS403)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)