-
Notifications
You must be signed in to change notification settings - Fork 0
/
shape2_quad.m
33 lines (25 loc) · 839 Bytes
/
shape2_quad.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Shape2_Quad.m - 1/12/16 %
% author: Tehila Stone | Theo Dimitrasopoulos %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [N, Nr, Ns] = shape2_quad(r,s)
%o = [1; 1; 1; 1];2
N = zeros(1,4);
Nr = zeros(1,4);
Ns = zeros(1,4);
N1 = 1/4*(1-r(1))*(1-s(1));
N2 = 1/4*(1+r(2))*(1-s(2));
N3 = 1/4*(1+r(3))*(1+s(3));
N4 = 1/4*(1-r(4))*(1+s(4));
N(1,1) = N1;
N(1,2) = N2;
N(1,3) = N3;
N(1,4) = N4;
Nr(1,1) = 1/4*(-1+s(1));
Nr(1,2) = 1/4*(1-s(2));
Nr(1,3) = 1/4*(1+s(3));
Nr(1,4) = 1/4*(-1-s(4));
Ns(1,1) = 1/4*(-1+r(1));
Ns(1,2) = 1/4*(-1-r(2));
Ns(1,3) = 1/4*(1+r(3));
Ns(1,4) = 1/4*(1-r(4));