Tuesday, May 20, 2008

Assingment #3, Question 3

For this question we have to extend question #2 to 3 colours c1, c2, c3 and find the relative percentages of each colour in composing a given colour c that is found within the triangle formed by c1, c2, c3.

We can use the general expression for finding the relative percentagies of c1 and c2 found in question 2; namely,

(x,y) = m1(x1, y1) + m2(x2, y2), where m1 is the decimal representation of distance(c1, c)/distance(c1, c2) and similarly m2 = distance(c, c2)/distance(c1, c2).

Another way we can think about this is that if we multiply m1 by x1 and m2 by x2, then add these two products together, then we will get the x-value for the colour 'c', which lays on the straight line between c1 and c2. Similarly for c's y-value.

Now extend this to 3 colours.

(x,y) = m1(x1, y1) + m2(x2, y2) + m3(x3, y3).

Note that m3 = 1 - m1 - m2 since we are dealing with fractions of 3 contributing colours that compose the colour c, which lays within a triangle whose vertices are c1, c2, c3. The percentage of each colour in the composition of colour 'c' will be 100% or 1. I will use 1.

So,

x = m1x1 + m2x2 + m3x3 (1)

y = m1y1 + m2y2 + m3y3 (2)

=> x = m1x1 + m2x2 + (1-m1-m2)x3 (1)

=> y = m1y1 + m2y2 + (1-m1-m2)y3 (2)

Solving for m1 in equation 1 you get:

m1 = [x - x3 - m2 (x2-x3)] / (x1 - x3)

Sub m1 into equation (2) and solve for m2:

m2 = (-x1y+x3y+xy1-x3y1-xy3+x1y3) / (x2y1-x3y1-x1y2+x3y2-x2y3+x1y3)

Once you have m1 and m2, solve for m3 by using m3 = 1 - m1 - m2.

So to find the relative percentages all you need to know are the coordinates for c1(x1, y1), c2(x2, y2), c3(x3, y3) and c(x,y).

Assignment #3, Question2

For this question Varvara Nika's blog was useful. I looked at their entry and compared it with my class notes and arrived at a better understanding, for myself, of this question.

To give credit to Varvara, I have taken their solution and tried to 'fill' in details as to what they were doing in the hopes that others might use our solution to help them out on their own assignment. You will notice that I have taken segments of Varvara's solution and added my own details.

In class prof Zabrocki gave us the following example:

0.7(x_1, y_1) + 0.2(x_2, y_2) + 0.1(x_3, y_3) = an average = a specific colour within that triangle in the chromaticity diagram

We have to use this note to help us specialize to only 2 colour cases.

For this question it is given that c_1 and c_2 are two valid colours in the chromaticity diagram with coordinates (x_1, y_1) and (x_2, y_2), respectively.

We also know that a colour 'c' is located on a line from c_1 to c_2, and has coordinates (x, y).



Based on our note from class, this colour c is a combination of c_1 and c_2 (will write c1 and c2 from here on), which can be described in what percent of c1 and c2 are in c.

How do we calculate the relative percentages of c1 and c2 which make the colour c?

Well, we need to calculate the distance from c1 to c2, the distance from c to c1 and lastly c to c2.

Recall that the distance formula is:



Once we have this, we can find a distance ratio in the form of (c to c1) divided by (c1 to c2) [Varvara calls this m_1] and then multiply by 100 to get the percent of c1 in c. Similarly we find the percent of c2 in c by calulating (c to c2) divided by (c1 to c2) [Varvara calls this m_2] multiplied by 100.

Writing this explanation algebraically we get (as given by Varvara):



This is a general expression for computing the relative percentages of c1 and c2 in a colour c laying on a straight line joining c1 and c2, if given the (x,y) coordinates of c1 and c2 within the chromaticity diagram.

Another general expression we can use is simply a modification of what Prof. Zabrocki gave us in class (for only 2 colours)

x = m_1(x_1) + m_2(x_2)

y= m_1(y_1) + m_2(y_2)

Written as one expression: (x,y)=m_1(x_1, y_1) + m_2(x_2, y_2).

Sunday, May 18, 2008

Assignment #3, Question 1

Using the chromaticity diagram on p. 400 of our text, make a table of wavelenghts vs. x, y, z on the outside of the daigram. Next, plot the data.

What do these three graphs represent?

I do not have a textbook as yet and I am not sure if there is an accurate table of values for the wavelengths in the textbook already. The x and y data I used to fill my table have been taken from Maddie's blog located at
http://maddiemath.blogspot.com/
Thanks Maddie!



The resulting graphs are as follows: