-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnot2.m
39 lines (37 loc) · 1001 Bytes
/
not2.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
34
35
36
37
38
39
function value = not2 ( x1, y1, x2, y2, x3, y3, x4, y4 )
%*****************************************************************************80
%
%% NOT2 evaluates a factor for serendipity basis functions.
%
% Discussion:
%
% not2(x1,y1,x2,y2,x3,y3,x4,y4) evaluates at the point (x1,y1), the basis
% factor that is 0 at (x2,y2) and (x3,y3) and 1 at (x4,y4):
%
% ( ( x1 - x2 ) * ( y3 - y2 ) - ( x3 - x2 ) * ( y1 - y2 ) )
% / ( ( x4 - x2 ) * ( y3 - y2 ) - ( x3 - x2 ) * ( y4 - y2 ) )
%
% Licensing:
%
% This code is distributed under the GNU LGPL license.
%
% Modified:
%
% 28 June 2014
%
% Author:
%
% John Burkardt
%
% Parameters:
%
% Input, real X1, Y2, the evaluation point.
%
% Input, real X2, Y2, X3,Y3, values that define the factor.
%
% Output, real VALUE, the value of the basis function factor.
%
value = ( ( x1 - x2 ) * ( y3 - y2 ) - ( x3 - x2 ) * ( y1 - y2 ) ) ...
/ ( ( x4 - x2 ) * ( y3 - y2 ) - ( x3 - x2 ) * ( y4 - y2 ) );
return
end