Skip to content

Commit cd9d1ae

Browse files
committed
g
1 parent 7bac5ed commit cd9d1ae

37 files changed

+24
-260
lines changed

Hyperbolic.mlx

-169 Bytes
Binary file not shown.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ In this matlab program, you can calculate the following:
1515

1616
It is recommended to use the latest version of matlab
1717

18-
19-
## examples
18+
**Input**: parametric equation
19+
This routine will automatically calculate metrics induced by the ambient three-dimensional euclidean space.
20+
## some sample outputs
2021
|![](images/sphere_geodesic.png)|
2122
|:----:|
2223
|**sphere geodesic**|

circle.mlx

30.6 KB
Binary file not shown.

cylinder.mlx

9.9 KB
Binary file not shown.

hjs.m renamed to differential_geometry.m

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
classdef hjs < matlab.System
1+
classdef differential_geometry < matlab.System
22
% Untitled Add summary here
33
%
44
% This template includes the minimum set of functions required
@@ -16,15 +16,15 @@
1616
Ricci_tensor;
1717
Scalar_curvature;
1818
Gauss_curvature;
19-
19+
FaceColor;
2020
alpha=1;
2121
scale=0.9;
2222
end
2323

2424

2525

2626
methods
27-
function obj = hjs(varargin)
27+
function obj = differential_geometry(varargin)
2828
% Support name-value pair arguments when constructing object
2929
setProperties(obj,nargin,varargin{:})
3030
end
@@ -132,38 +132,39 @@
132132
[C,IA,IC]=uniquetol(Xf(DT.Points(:,1)',DT.Points(:,2)',DT.Points(:,1)')'-tXf(DT.Points(:,1)')','ByRows',true);
133133
TR=triangulation(IC(DT.ConnectivityList),C);
134134
VV=vertexNormal(TR);
135-
lig = light;
136135
if(draw_curvature)
137136
curvatureF=matlabFunction(obj.Scalar_curvature,'vars',{'u1','u2'});
138137
color=curvatureF(DT.Points(:,1),DT.Points(:,2));
139138
if(numel(color)==1)
140139
color=repmat(color,[size(DT.Points,1),1]);
141140

142141
end
143-
pat=patch('Faces',IC(DT.ConnectivityList),'Vertices',C,'FaceVertexCData',color(IA),'FaceColor','interp','EdgeColor','none','VertexNormals',VV,'FaceLighting','gouraud',"FaceAlpha",obj.alpha);
144-
pat.AmbientStrength=1;
145-
pat.DiffuseStrength=1;
146-
pat.SpecularStrength=1;
147-
% pat.SpecularExponent=1;
148-
pat.BackFaceLighting='unlit';
142+
pat=patch('Faces',IC(DT.ConnectivityList),'Vertices',C,'FaceVertexCData',color(IA),'FaceColor','interp','EdgeColor','none','VertexNormals',VV,"FaceAlpha",obj.alpha);
143+
144+
% pat.BackFaceLighting='unlit';
149145
colormap parula;
150146
view(3);
151147

152-
148+
153149
colorbar;
154150
else
155-
pat=patch('Faces',IC(DT.ConnectivityList),'Vertices',C,'FaceVertexCData',C(:,1),'FaceColor','interp','EdgeColor','none','VertexNormals',VV,'FaceLighting','gouraud',"FaceAlpha",obj.alpha);
156-
pat.AmbientStrength=1;
157-
pat.DiffuseStrength=1;
158-
pat.SpecularStrength=1;
159-
% pat.SpecularExponent=1;
151+
if(isempty(obj.FaceColor))
152+
pat=patch('Faces',IC(DT.ConnectivityList),'Vertices',C,'FaceVertexCData',C(:,1),'FaceColor','interp','EdgeColor','none','VertexNormals',VV,'FaceLighting','gouraud',"FaceAlpha",obj.alpha);
153+
154+
else
155+
pat=patch('Faces',IC(DT.ConnectivityList),'Vertices',C,'FaceColor',obj.FaceColor,'EdgeColor','none','VertexNormals',VV,'FaceLighting','gouraud',"FaceAlpha",obj.alpha);
156+
157+
end
158+
160159
pat.BackFaceLighting='unlit';
161160
view(3);
162-
163-
161+
camlight;
162+
material shiny;
163+
164164
end
165-
lig.Position=-campos;
166-
% camlight;
165+
166+
167+
167168
end
168169
function []= curvature_tensor(obj)
169170
n=obj.n;

generate_git_image.mlx

130 KB
Binary file not shown.

generate_git_image2.mlx

213 KB
Binary file not shown.

hh.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

hjs.asv

Lines changed: 0 additions & 226 deletions
This file was deleted.

images/sphere_geodesic.png

993 KB
Loading

0 commit comments

Comments
 (0)