Data update
This commit is contained in:
parent
29a5eea0d4
commit
5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions
26
Task/Vector-products/PascalABC.NET/vector-products.pas
Normal file
26
Task/Vector-products/PascalABC.NET/vector-products.pas
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
uses System.Numerics;
|
||||
|
||||
function DotProduct(v1,v2: Vector3): real
|
||||
:= v1.x * v2.x + v1.y * v2.y + v1.z * v2.z;
|
||||
|
||||
function CrossProduct(v1,v2: Vector3): Vector3
|
||||
:= new Vector3(v1.y * v2.z - v1.z * v2.y,
|
||||
v1.z * v2.x - v1.x * v2.z,
|
||||
v1.x * v2.y - v1.y * v2.x);
|
||||
|
||||
function ScalarTripleProduct(a,b,c: Vector3): real
|
||||
:= DotProduct(a, CrossProduct(b, c));
|
||||
|
||||
function VectorTripleProduct(a,b,c: Vector3): Vector3
|
||||
:= CrossProduct(a, CrossProduct(b, c));
|
||||
|
||||
|
||||
begin
|
||||
var a := new Vector3(3,4,5);
|
||||
var b := new Vector3(4,3,5);
|
||||
var c := new Vector3(-5,-12,-13);
|
||||
Writeln(DotProduct(a, b));
|
||||
Writeln(CrossProduct(a, b));
|
||||
Writeln(ScalarTripleProduct(a, b, c));
|
||||
Writeln(VectorTripleProduct(a, b, c));
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue