TPoint3DCrossProduct (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example illustrates how to use the CrossProduct method to get the cross product between two 3D points.

Code

uses
  System.SysUtils,
  System.Types;
 
var
  aPoint1, aPoint2, Result: TPoint3D;
 
begin
    aPoint1.Create(1.2, 0.5, 6.3);
    aPoint2.Create(3.3, 4.0, 9.9);
 
    Result := aPoint1.CrossProduct(aPoint2);
    writeln('Result.X:',Format('%2.2f', [Result.X]));
    writeln('Result.Y:',Format('%2.2f', [Result.Y]));
    writeln('Result.Z:',Format('%2.2f', [Result.Z]));
end.

Uses