|
Post by James :) (aka Madcow) on Jul 25, 2008 13:47:21 GMT -5
i've see a lot of codes use this function yet basic4gl dosn't have it so it would awesome if it did!
|
|
nutter3
Posts a bit
Pythonized for a while ;)
Posts: 117
|
Post by nutter3 on Jul 28, 2008 19:09:15 GMT -5
ummm is it not possible to implemet it yourself if you need it? I mean, \mathbf{a} \cdot \mathbf{b} = |\mathbf{a}| \, |\mathbf{b}| \cos \theta \, is the formula right..? so you can just go Sub DotProduct (stuff) formula EndSub?
it seems to me that would work..? -H
|
|
|
Post by James :) (aka Madcow) on Jul 29, 2008 3:44:49 GMT -5
I don't really under stand the formula and how i would translate it
|
|
|
Post by DJLinux on Jul 29, 2008 11:19:55 GMT -5
take a look at Dot2#() !!! function Dot#(a#(),b#()) return a#(0)*b#(0)+a#(1)*b#(1)+a#(2)*b#(2) end function
function Dot2#(a#(),b#()) return a#*b# end function
dim v1#(2),v2#(2) v1#(0)=1 v1#(1)=2 v1#(2)=3 v2#(0)=3 v2#(1)=2 v2#(2)=1
printr Dot#(v1#,v2#) printr Dot2#(v1#,v2#)
|
|
nutter3
Posts a bit
Pythonized for a while ;)
Posts: 117
|
Post by nutter3 on Jul 29, 2008 13:41:36 GMT -5
Oh oops madcow, i thought them characters would work.. DJ has it explained pretty perfeckt there.. -H
|
|
|
Post by Tom Mulgrew on Jul 29, 2008 21:33:43 GMT -5
i've see a lot of codes use this function yet basic4gl dosn't have it so it would awesome if it did! From the Programmer's guide: vec1 * vec2 Returns the dot product of vec1 and vec2, as a real value.
|
|
|
Post by Darkjester on Jul 29, 2008 22:01:01 GMT -5
How Would I convert Data to Real From Binary and from binary data to Real?
|
|