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: planeIntersect.m
    path of file: ./repos/mtex/geometry/@vector3d
    
    the code of the file until where you have to start completion: function v = planeIntersect(n1,n2,n3,d)
% intersection of three planes
%
% Input
%  n1,n2,n3 - plane normal @vector3d, <x,n_i> = d_i
%  d        - [d1,d2,d3] distances of the three planes to the origin
%
% Output
%  v - @vector3d
%
% See also

    
function v = planeIntersect(n1,n2,n3,d)
% intersection of three planes
%
% Input
%  n1,n2,n3 - plane normal @vector3d, <x,n_i> = d_i
%  d        - [d1,d2,d3] distances of the three planes to the origin
%
% Output
%  v - @vector3d
%
% See also
% vector3d/lineIntersect
%

% ensure last argument is vector3d
if nargin == 4
  d = vector3d(d);
else
  d = vector3d(1,1,1);
end