unit soundmath;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, var_const;

function CalcX2D(const X: single): single;
function CalcY2D(const Y: single): single;

implementation

function CalcX2D(const X: single): single;
begin
  Result := (X - Game.GetScreenW / 2) * (1 / Game.GetScreenW / 2);
end;

function CalcY2D(const Y: single): single;
begin
  Result := (Y - Game.GetScreenH / 2) * (1 / Game.GetScreenH / 2);
end;

end.
