Anonymous user
Vector products: Difference between revisions
m
→{{header|REXX}}: simplified some code.
m (→{{header|Phix}}: added syntax colouring the hard way, phix/basics) |
m (→{{header|REXX}}: simplified some code.) |
||
Line 4,031:
call tellV 'vector B =', b /* " " B " " " */
call tellV 'vector C =', c /* " " C " " " */
say
call tellV ' dot product [A∙B] =', dot(a, b)
call tellV 'cross product [AxB] =', cross(a, b)
call tellV 'scalar triple product [A∙(BxC)] =', dot(a, cross(b, c) )
call tellV 'vector triple product [Ax(BxC)] =', cross(a, cross(b, c) )
exit
/*──────────────────────────────────────────────────────────────────────────────────────*/
cross: procedure; arg $1 $2 $3,@1 @2 @3;
dot: procedure; arg $1 $2 $3,@1 @2 @3;
/*──────────────────────────────────────────────────────────────────────────────────────*/
tellV: procedure; parse arg name,x y z;
{{out|output|text= when using the default internal inputs:}}▼
▲{{out|output|text= when using the default inputs:}}
<pre>
vector A = 3 4 5
|