Formula:
C1*B+C2B^2+C3*G+C4*G*B+C5*G*B^2+C6*G^2+
C7*G^2*B+C8*R+C9*R*B+C10*R*B^2+C11*R*G+
C12*R*G*B+C13*R*G^2+C14*R^2+C15*R^2*B+
C16*R^2*G+C17*1+C18*R^3+C19*G^3+C20*B^3
Go:
var C1 = -0.0343
var C2 = 0.4062
...snipped
C1*B + C2*math.Pow(B, 2) + C3*G + C4*G*B +
C5*G*math.Pow(B, 2) + C6*G*math.Pow(G, 2) +
C7*math.Pow(G, 2)*B + C8*R + C9*R*B +
C10*R*math.Pow(B, 2) + C11*R*G + C12*R*G*B +
C13*R*math.Pow(G, 2) + C14*math.Pow(R, 2) +
C15*math.Pow(R, 2)*B + C16*math.Pow(R, 2)*G +
C17*1 + C18*math.Pow(R, 3) + C19*math.Pow(G, 3) +
C20*math.Pow(B, 3)
All my code works, but I'm seeing values greater than 1
and I should be expecting values in the range of 0
to 1
, so I'm assuming that math.Pow
isn't what I should be using. New to Go, any help greatly appreciated.