Vector products: Difference between revisions
Content deleted Content added
Line 135: | Line 135: | ||
function Vector.vector_triple( A, B, C ) |
function Vector.vector_triple( A, B, C ) |
||
return Vector.cross( A, Vector.cross( B, C ) ) |
return Vector.cross( A, Vector.cross( B, C ) ) |
||
end |
end |
||
A = Vector.new( 3, 4, 5 ) |
|||
B = Vector.new( 4, 3, 5 ) |
|||
C = Vector.new( -5, -12, -13 ) |
|||
print( Vector.dot( A, B ) ) |
|||
r = Vector.cross(A, B ) |
|||
print( r.x, r.y, r.z ) |
|||
print( Vector.scalar_triple( A, B, C ) ) |
|||
r = Vector.vector_triple( A, B, C ) |
|||
print( r.x, r.y, r.z )</lang> |
|||
<pre>49 |
|||
5 5 -7 |
|||
6 |
|||
-267 204 -3</pre> |
|||
=={{header|Python}}== |
=={{header|Python}}== |