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: circle3dOrigin.m
    path of file: ./repos/matGeom/matGeom/geom3d
    
    the code of the file until where you have to start completion: function ori = circle3dOrigin(varargin)
%CIRCLE3DORIGIN Return the first point of a 3D circle.
%
%   P = circle3dOrigin([XC YC ZC R THETA PHI])
%   P = circle3dOrigin([XC YC ZC R THETA PHI PSI])
%   Returns the origin point of the circle, i.e. the first point used for
%   drawing circle.
%
%   See also 
%   circles3d, points3d, circle3dPosition


    
function ori = circle3dOrigin(varargin)
%CIRCLE3DORIGIN Return the first point of a 3D circle.
%
%   P = circle3dOrigin([XC YC ZC R THETA PHI])
%   P = circle3dOrigin([XC YC ZC R THETA PHI PSI])
%   Returns the origin point of the circle, i.e. the first point used for
%   drawing circle.
%
%   See also 
%   circles3d, points3d, circle3dPosition

% ------
% Author: David Legland 
% E-mail: david.legland@inrae.fr
% Created: 2005-02-21
% Copyright 2005-2023 INRA - TPV URPOI - BIA IMASTE

% get center and radius
circle = varargin{1};
xc = circle(:,1);
yc = circle(:,2);
zc = circle(:,3);
r  = circle(:,4);

% get angle of normal
theta   = circle(:,5);
phi     = circle(:,6);

% get roll
if size(circle, 2)==7
    psi = circle(:,7);
else
    psi = zeros(size(circle, 1), 1);
end