-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBorde.m
More file actions
61 lines (42 loc) · 1.89 KB
/
Copy pathBorde.m
File metadata and controls
61 lines (42 loc) · 1.89 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
classdef Borde < hgsetget
% BORDE es el objeto que contiene las coordenadas
% del borde que delimita la geometria superficial
properties
tipoBorde
coordenadasXY
end
methods
function thisBorde = Borde()
thisBorde;
end %function Borde
function thisBorde = generaBordeCircular(thisBorde, radio, centro)
% function thisBorde = generaBordeCircular(thisBorde, radio, centro)
% Función que construye las coordenadas para
% el borde circular = [xBorde, yBorde]
xcircular = radio*cos((0:1:359)*pi/180) + centro(1);
ycircular = radio*sin((0:1:359)*pi/180) + centro(2);
bordeCircular = [xcircular', ycircular'];
thisBorde.tipoBorde = 'Circular';
thisBorde.coordenadasXY = bordeCircular;
end %function generaBordeCircular
function thisBorde = generaBordeRectangular(thisBorde, ladoA, ladoB, centro)
% function thisBorde = generaBordeRectangular(thisBorde, ladoA, ladoB, centro)
% Función que construye las coordenadas para
% el borde rectangular = [xBorde, yBorde]
xRectangular = [centro(1) - ladoA*0.5, centro(1) + ladoA*0.5];
xRectangular = [xRectangular, xRectangular(2), xRectangular(1), xRectangular(1)];
yRectangular = [centro(2) - ladoB*0.5, centro(2) - ladoB*0.5];
yRectangular = [yRectangular, centro(2) + ladoB*0.5, centro(2) + ladoB*0.5, centro(2) - ladoB*0.5 ];
bordeRectangular = [xRectangular', yRectangular'];
thisBorde.tipoBorde = 'Rectangular';
thisBorde.coordenadasXY = bordeRectangular;
end %function generaBordeRectangular
function matrizIndices = puntosDentroBorde(borde, espacioX, espacioY)
coordenadasXY = borde.coordenadasXY;
[meshX meshY] = meshgrid(espacioX, espacioY); % Construyo meshgrid de dominio
matrizIndices = inpolygon(meshX, meshY, coordenadasXY(:,1), coordenadasXY(:,2));
end % function puntosDentroBorde
% function bordeDatos()
% end
end %methods
end %classdef