Home > matutils > mosaic > raring.m

raring

PURPOSE ^

function raring(ra, format)

SYNOPSIS ^

function raring(ra, format)

DESCRIPTION ^

 function raring(ra, format)

 Draw a ring of constant ra, in 3D

 Inputs:

   ra    - The right ascension, in radians

   format - A format string for plotting (e.g., 'g' to plot as a green line)

 (EML)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function raring(ra, format)
0002 
0003 % function raring(ra, format)
0004 %
0005 % Draw a ring of constant ra, in 3D
0006 %
0007 % Inputs:
0008 %
0009 %   ra    - The right ascension, in radians
0010 %
0011 %   format - A format string for plotting (e.g., 'g' to plot as a green line)
0012 %
0013 % (EML)
0014 
0015 t = 0:pi/100:2*pi;
0016 xyz = [cos(t); zeros(size(t)); sin(t)];
0017 
0018 res = zeros(size(xyz));
0019 
0020 cr = cos(ra);
0021 sr = sin(ra);
0022 rotr = [cr, -sr, 0; sr, cr, 0; 0, 0, 1];
0023 
0024 for it=1:size(xyz,2)
0025   res(:,it) = rotr * xyz(:, it);
0026 end
0027 
0028 plot3(res(1,:),res(2,:),res(3,:), format)
0029 
0030 return
0031

Generated on Sun 14-Jun-2015 17:12:45 by m2html © 2005