apophysis/2.10/Source/VarEyefish.pas

50 lines
1.1 KiB
ObjectPascal
Raw Normal View History

unit VarEyefish;
interface
uses
BaseVariation, XFormMan;
type
TVariationEyefish = class(TBaseVariation)
public
class function GetName: string; override;
class function GetInstance: TBaseVariation; override;
procedure CalcFunction; override;
end;
implementation
uses
math;
// TVariationEyefish
///////////////////////////////////////////////////////////////////////////////
procedure TVariationEyefish.CalcFunction;
var
2005-09-15 12:43:23 -04:00
r: double;
begin
2005-09-15 12:43:23 -04:00
r := 2 / (sqrt(FTx^ * FTx^ + FTy^ * FTy^) + 1);
FPx^ := FPx^ + vvar * r * FTx^;
FPy^ := FPy^ + vvar * r * FTy^;
end;
///////////////////////////////////////////////////////////////////////////////
class function TVariationEyefish.GetInstance: TBaseVariation;
begin
Result := TVariationEyefish.Create;
end;
///////////////////////////////////////////////////////////////////////////////
class function TVariationEyefish.GetName: string;
begin
Result := 'eyefish';
end;
///////////////////////////////////////////////////////////////////////////////
initialization
RegisterVariation(TVariationEyefish);
end.