At 11:54 -0800 12/17/09, Jon Lang wrote: >> And I think there's a Math error in the 4th line: you don't need the >> components of a vector to do a dot product with that vector -- so it is just >> >> my ($x, $y) = $vector «·« ( [1, 0], [0, 1] ); > >True enough. > >> Which makes me wonder if all of them are just the dot-product of an object >> with a role (i.e. it uses the .^attr of the role, not the object):
I became an observer a few years ago when vector operations were being introduced in perl6. I was excited, thinking that perl6 was actually gong to do mathematics. After a while I became resigned to the fact that dot and cross products were not what was being offered. Instead a product of two vectors was to be simply a component by component multiply that produced another "vector" of the same size as the arguments. It appears that is what is being done in the formula above. OK. Perhaps there really are uses for that operation in the computing world. But please don't call the result a "dot" product! It will be misinterpreted forever in the same way that the term kilo was forever made ambiguous when computer types decided it meant 2**10 instead of 10**3. Dot and cross products have been around since Newton. Kilo since the mid 1800s. Phase is a good name for the angular part of a polar complex number. It's actually used that way by electrical engineers working with three phase power distribution. But those guys also expect a dot product to be a scalar which is the sum of the products of the vector components. True power is charged for by computing the dot product of voltage and current vectors expressed as complex numbers. That requires the original meaning of the dot product. $dotproduct = @vector1 <<.>> @vector2; In scalar context would be nice but it can come later as an add-on. -- --> From the U S of A, the only socialist country that refuses to admit it. <--