TPoint3DDotProduct (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example illustrates how to use DotProduct method to obtain the product between two 3D points.

Code

uses
  System.SysUtils,
  System.Types;

var
  aPoint1, aPoint2: TPoint3D;
  Result: Single;

begin
    aPoint1.Create(1.2, 0.5, 6.3);
    aPoint2.Create(3.3, 4.0, 9.9);
    
    Result := aPoint1.DotProduct(aPoint2);
    writeln(Format('%2.2f', [Result]));
end.

Uses