You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: trap_stiffness.m
    path of file: ./repos/ott/+ott
    
    the code of the file until where you have to start completion: function [kf, kt, K] = trap_stiffness(beam, T, varargin)
% TRAP_STIFFNESS calculate the force and torque trap stiffness
%
% [kf, kt, K] = TRAP_STIFFNESS(beam, T) calculate the trap stiffness
% for the force, kf, and torque, kt for a particle, T, in a beam.
% K is the full 6x2N stiffness matrix, each column corresponds to a
% different direction.  K can be multiplied by the drag tensor to
% calculate the fluid+optical trap stiffness.
%
% TRAP_STIFFNESS(..., 'position', x0) and TRAP_STIFFNESS(..., 'rotation', R)
% specify the particle position and rotation.
%
% TRAP_STIFFNESS(..., 'direction', d) specifies the directions to
% calculate the trap stiffness in.  Specify 'beam' for the XYZ direction
% for the current beam orientation.  For specific directions, specify
% a 3xN matrix of vectors to calculate the force along and torque around.
% Default is 'beam'.
%
% TRAP_STIFFNESS(..., 'method', m) specifies the method to use for
% calculating the trap stiffness.
% Supported methods [calculations direction/other]:
%     'cntr'    use central differences [4/0]
%     'fwd'     use forward differences [2/1]
%
% TRAP_STIFFNESS(..., 'step', [ dx dt ]) specifies the position and
% torque calculation step sizes (in beam units and radians).
% Default: 1e-3/beam.k_medium and 1e-3.
%
% This file is part of the optical tweezers toolbox.
% See LICENSE.md for information about using/distributing this file.

p = inputParser;
p.addParameter('direction', 'beam');
p.addParameter('method', 'cntr');
p.addParameter('rotation', eye(3));
p.addParameter('position', [0;0;0]);

    
function [kf, kt, K] = trap_stiffness(beam, T, varargin)
% TRAP_STIFFNESS calculate the force and torque trap stiffness
%
% [kf, kt, K] = TRAP_STIFFNESS(beam, T) calculate the trap stiffness
% for the force, kf, and torque, kt for a particle, T, in a beam.
% K is the full 6x2N stiffness matrix, each column corresponds to a
% different direction.  K can be multiplied by the drag tensor to
% calculate the fluid+optical trap stiffness.
%
% TRAP_STIFFNESS(..., 'position', x0) and TRAP_STIFFNESS(..., 'rotation', R)
% specify the particle position and rotation.
%
% TRAP_STIFFNESS(..., 'direction', d) specifies the directions to
% calculate the trap stiffness in.  Specify 'beam' for the XYZ direction
% for the current beam orientation.  For specific directions, specify
% a 3xN matrix of vectors to calculate the force along and torque around.
% Default is 'beam'.
%
% TRAP_STIFFNESS(..., 'method', m) specifies the method to use for
% calculating the trap stiffness.
% Supported methods [calculations direction/other]:
%     'cntr'    use central differences [4/0]
%     'fwd'     use forward differences [2/1]
%
% TRAP_STIFFNESS(..., 'step', [ dx dt ]) specifies the position and
% torque calculation step sizes (in beam units and radians).
% Default: 1e-3/beam.k_medium and 1e-3.
%
% This file is part of the optical tweezers toolbox.
% See LICENSE.md for information about using/distributing this file.

p = inputParser;
p.addParameter('direction', 'beam');
p.addParameter('method', 'cntr');
p.addParameter('rotation', eye(3));
p.addParameter('position', [0;0;0]);
p.addParameter('step', [ 1e-3/beam.k_medium 1e-3 ]);
p.parse(varargin{:});

% Rotate the beam
if ~isempty(p.Results.rotation)
  beam = beam.rotate(p.Results.rotation);
end