%% ================================================================
% Hyperboloid of one sheet with z/theta coordinates.
% ----------------------------------------------------------------
% John Kerl
% Math 537A
% 2007-11-27
% ----------------------------------------------------------------

function [x, y, z, ds, dt] = hyp1setup()
zmin     =  -5.0;
zmax     =   5.0;
nz       =  50;
dz       = (zmax-zmin)/nz;

thetamin =   0.0;
thetamax =   2.0*pi;
ntheta   =  50;
dtheta   = (thetamax-thetamin)/ntheta;

% Extend the theta by one dtheta unit to avoid having a slit in the
% plotted surface.
[paramz,theta] = meshgrid(zmin:dz:zmax, thetamin:dtheta:thetamax+dtheta);

%% Apply the parameterization to obtain R^3 coordinates

r = sqrt(1 + paramz.^2);
x = r .* cos(theta);
y = r .* sin(theta);
z = paramz;

% Two sheets (not this file): z = sqrt(1 + r.^2)
% One sheet  (this file):     r = sqrt(1 + z.^2)

ds = dz;
dt = dtheta;
