Math problem...

Posted By: MMike

Math problem... - 10/22/09 23:08

hello.

this is my problem...

i want to know the % of the final color that is yellow.

We know that yellow = red + green.

so if i have:
10 parts of red + 10 parts of green = 20 parts , that will mix and give 100% of yellow

if i have 10 parts of red + 5 parts of green = 15 parts
here 5 parts of green can miz with 5 parts of red, giving 10 parts of yellow and 5 parts of non reacted red, the final color is not 100% yellow but only 50% ( i think!!)

this is the problem, what is the math equation.. that i can know when i mix A quantities of red + B quantities of green, which final percentage i will get of yellow. :S

maybe this is easy than i think but im missing something...

Please help me this is really frustrating. i feel lossing IQ lol

i tryed %yello = (A/B) *100 but this is not the solution...
Posted By: MMike

Re: Math problem... - 10/22/09 23:52

i think i solved lol. but if anyone wants to answer.. its free.
Posted By: Superku

Re: Math problem... - 10/23/09 01:07

Haha....... hm

Quote:
if i have 10 parts of red + 5 parts of green = 15 parts
here 5 parts of green can miz with 5 parts of red, giving 10 parts of yellow and 5 parts of non reacted red, the final color is not 100% yellow but only 50%


There are no 5 parts of red that do not react with green, yellow is no base color such as red or green or blue, it is a result of mixing them together (as you know). As a result there is no real percentage of pure yellow.

It would be easier to help you if I knew the purpose of your question.
Posted By: AlexH

Re: Math problem... - 10/23/09 01:16

Your issue doesn't really make sense from an external standpoint nor could I really understand your engrish.

Colors on a computer don't come in 'parts' they come in 3 bytes: Red Blue Green. So I don't get what you mean by 'parts'. However, I assume you aren't have troubles any more so it doesn't matter really, just know your presentation doesn't make sense.
Posted By: Elektron

Re: Math problem... - 10/23/09 02:10

The addition of ink is difrent of light.
Computers use light addiction. Painters use negative mixing inks.
Posted By: MMike

Re: Math problem... - 10/24/09 11:48

hld on
Posted By: Oxy

Re: Math problem... - 10/24/09 13:28

Just imagine a lightspectrum

http://hidden-technology.org/images/pics%20for%20site/lightspectrum.jpg


The human eye has receptors for 3 colorranges
which have their medium approximately at
red green and blue.

http://upload.wikimedia.org/wikipedia/commons/c/c2/Cone-response.png

For a human to see yellow, both the green and
red lightemitters (in the computerscreen) need to be on
(in about the same strenght).
Without blue beeing active.

If blue is active, the yellow will get brighter, up to
reaching a white-yellow.

There are other basecolors used in Printing media for example,
(magenta, cyan and yellow)
All have the purpose to simulate a full spectrum
by adjusting their values accordingly.

A true yellow can only be archived by emitting light in
the specific frequency (around 590nanomater). But the human eye approximates
yellow anyhow using its 3 color receptors.

Posted By: MMike

Re: Math problem... - 10/24/09 17:34

OK SO THE PROBLEM Here, the real problem is this one.. which is almost lik the yellow thing , because we are talking about combining things.


i know that Cl2 can react with H2 to form 2 HCL righ?

so if i have 10 parts of Cl2, and 15 parts of H2.

10 parts of Cl2 will combine with 10 parts of H2, leaving intact, 5 parts (excess) of H2.

So how do i calculate that reacting percentage?

if i have 10 to 10 its 100% used
if i have 5 to 10 its only 50%
etc etc, there is a expression that can be made here right?
that is what im looking for, i just talk about the colors to simplify but i think it was worse.
Posted By: MMike

Re: Math problem... - 10/24/09 20:40

i could simply do the 5cl / 10H2 = 0.5 HCl , so 50%
in a formula it would be.. a/b = c , which a must be the minor number..
but because i dont want any hand of man here, i must make the expression by it self tell which is the minor and minor...

For that i will use a genetic Approach, by Mendel.

if we have the specie A and B, being A a pure genotype and b a pure genotype, it would be 2DNA strands so 2 alleles for each chromossome.
Because im using pure reactants, like H2 or Cl , they are pure .. so AA and BB, HCl is Hybrid, (AB)
thus, AA x BB this will give an offspring of combination of

1AA + 1 BB + 2AB ( or more specifc 1 AB + 1 BA).
Ok so now that i know this... i can put this into the formula and purpose and intermediary algebra expression where i put this genetic heritage thing...

i will call it R(genotype). And there will be 4 of this.

R(genotype) : R(ab) , R(aa), R(bb) and R(ba).

if i make R=sign(alele 1 - oposite alele 1)X alele2.. i will get this distribution of R alele 1, alele2...
Raa=sign(a-b)x a
Rab=sign(a-b)x b
Rbb=sign(b-a)x b
Rba=sign(b-a)x a

filtering the negative values to be zero, and out of the add:

Raa=(1+sign(a-b))* a;
Rab=(1+sign(a-b))* b;
Rbb=(1+sign(b-a))* b;
Rba=(1+sign(b-a))* a;

now that i got the R function i can compose it on another function, that will determine which value is the lower one by its own.

%= ( ( (Rba/2) + (Rab/2)) / ((Raa/2) + (Raa/2) ))*100


The lite-c function final is this:

function percent(var a, var b){

var Rab,Rbb,Raa,Rba;
Raa=(1+sign(a-b))* a;
Rab=(1+sign(a-b))* b;
Rbb=(1+sign(b-a))* b;
Rba=(1+sign(b-a))* a;
return((((Rba/2)+(Rab/2))/((Raa/2)+(Rbb/2)))*100);
}


function main(){
var reacting_p=percent(5,10);
var reacting_p=percent(5,5);
var reacting_p=percent(10,5); // the inverse, function will determine the minor number and major automatically.

}


all this to avoid using If minor then ... in a single expressiong..

Perhaps theres a batter way, but i just came up with this and it works so..
Posted By: MMike

Re: Math problem... - 10/24/09 21:00

this is useful to know for example..

you want to do breed with cheese and meat(dont know the word?)

having 20 slices of cheese and 15 of meat , how many compleat breed with can have .
Posted By: Oxy

Re: Math problem... - 10/24/09 21:08

if the reaction is 1:1 (one unit to one unit)
Then the percentage is:

(min : max) * 100

example: 90 units A and 120 units B

(90 : 120) = 0.75
0.75 * 100 = 75%


example: 55 units A and 7 units B

(7: 55) = 0.127
0.127 * 100 = 12.7%
Posted By: MMike

Re: Math problem... - 10/24/09 22:12

right.. i know! but to calculate the min and max of 2 numbers .. thats the point

because if you have 90/120 and what if you have 120/90 that wont work, so it must know the min, and you dont want to out that, thepc should calculate from what you have..

So i forgot the mnual , there is that function min(a,b) lool so much work
Posted By: EvilSOB

Re: Math problem... - 10/24/09 22:37

Wouldnt this do what you are after?
result = minv(x,y) / maxv(x,y); as a 0.0->1.0 result
or
result = minv(x,y) / maxv(x,y) * 100; as a 0->100 (%) result
Posted By: MMike

Re: Math problem... - 10/25/09 00:13

yes it would.. but i didnt know there was a minv :S lool other wise i would avoid that math stuff lol.. well but it was fun to go trough it lol
Posted By: Oxy

Re: Math problem... - 10/25/09 11:06

come on, even of there where no min function,
you could use
if (a>b) max=a: min=b;
else max=b;min=a

you should be able to figure that out...
© 2023 lite-C Forums