[Master Index]
[Index for .]
beam_nst
(./beam_nst.m)
Function Synopsis
[n,s,t] = beam_nst(Pi,Pj,beta);
Help text
function [n,s,t] = beam_nst(Pi,Pj,beta);
%---Computes vectors n, s, and t for a beam element
% based on its end points and a specified rotation of
% the strong axis from the up direction (assumed to
% be y) or north (for columns; assumed to be x)
Cross-Reference Information
This function is called by
Listing of function ./beam_nst.m
function [n,s,t] = beam_nst(Pi,Pj,beta);
%function [n,s,t] = beam_nst(Pi,Pj,beta);
%%---Computes vectors n, s, and t for a beam element
%% based on its end points and a specified rotation of
%% the strong axis from the up direction (assumed to
%% be y) or north (for columns; assumed to be x)
%%---Could be global
up = [0;0;1];
north = [0;1;0];
%%---Get n from the end points
n = (Pj - Pi)/norm(Pj-Pi);
%%---Get a candidate t:
t = cross(n,up);
%--- Is it a column or a beam?
if norm(t) == 0
%---it's a column
s = [cos(beta);0;sin(beta)];
t = cross(n,s);
else
%%--it's a beam
s_temp = cross(t,n);
%%--now account for beta
s = cross(n,s_temp)*sin(beta)-cross(n,t)*cos(beta);
t = cross(n,s_temp)*cos(beta)+cross(n,t)*sin(beta);
end %--endif
n = column(n);
s = column(s/norm(s));
t = column(t/norm(t));
Produced by mat2html on Wed Jul 10 14:55:44 US/Pacific 1996
Cross-Directory links are: OFF