0001
0002
0003
0004
0005
0006
0007
0008
0009 close all
0010 addpath(genpath('../../General-Functions'))
0011
0012
0013 sugr_INIT
0014 ss = plot_init;
0015
0016
0017
0018 x = sugr_Point_2D([1,2]',0.00001*[2,2;2,6]);
0019 y = sugr_Point_2D([-1,0]',0.00001*[2,-1;-1,2]);
0020 u = sugr_Point_2D([0,2]',0.00001*[2,1;1,1]);
0021
0022
0023 z = sugr_construct_midpoint_Point_2D(x,y);
0024
0025
0026
0027 l = sugr_construct_join_Line_2D(x,y);
0028 sugr_show_Line_2D(l,'l');
0029
0030
0031 m1 = sugr_construct_midline_Line_2D(x,y);
0032 m2 = sugr_construct_midline_Line_2D(y,x);
0033
0034
0035 lp = sugr_construct_parallel_lx_Line_2D(l,u);
0036
0037 figure('Color','w','Position',[20 ss(2)/3 ss(1)/3 ss(2)/2])
0038 hold on
0039 xlim([-2,2]);
0040 ylim([-1,3]);
0041 sugr_plot_Point_2D(x,'.k','-b',2,40);
0042 sugr_plot_Point_2D(y,'.k','-b',2,40);
0043 sugr_plot_Point_2D(z,'.k','-b',2,40);
0044 sugr_plot_Point_2D(u,'.k','-b',2,40);
0045 sugr_plot_Line_2D(l,'-k','-r',2,40);
0046
0047
0048 axis equal
0049 title('Joining line ')
0050
0051 figure('Color','w','Position',[100+ss(1)/3 ss(2)/3 ss(1)/3 ss(2)/2])
0052 hold on
0053 xlim([-2,2]);
0054 ylim([-1,3]);
0055 sugr_plot_Point_2D(x,'.k','-b',2,40);
0056 sugr_plot_Point_2D(y,'.k','-b',2,40);
0057 sugr_plot_Point_2D(z,'.k','-b',2,40);
0058 sugr_plot_Line_2D(l,'-k','-r',2,40);
0059 sugr_plot_Line_2D(m2,'-k','-r',2,40);
0060 axis equal
0061 title('Midline ')
0062
0063
0064
0065 x = sugr_Point_2D([-2,1]', 0.000001*[2,2;2,6]);
0066 y = sugr_Point_2D([-1,1.5]', 0.000001*[2,-1;-1,2]);
0067 z = sugr_Point_2D([1,1.3]', 0.000001*[2,-2;-2,6]);
0068 u = sugr_Point_2D([1,-0.2]',0.000001*[2,1;1,2]);
0069
0070 l = sugr_construct_join_Line_2D(x,y);
0071 m = sugr_construct_join_Line_2D(z,u);
0072
0073 v = sugr_construct_intersection_Point_2D(l,m);
0074
0075 figure('Color','w','Position',[50+ss(1)/6 50 ss(1)/3 ss(2)/2])
0076 hold on
0077 xlim([-2,2]);
0078 ylim([-1,3]);
0079 sugr_plot_Point_2D(x,'.k','-b',2,40);
0080 sugr_plot_Point_2D(y,'.k','-b',2,40);
0081 sugr_plot_Point_2D(z,'.k','-b',2,40);
0082 sugr_plot_Point_2D(u,'.k','-b',2,40);
0083 sugr_plot_Point_2D(v,'.k','-b',2,40);
0084 sugr_plot_Line_2D(l,'-k','-r',2,40);
0085 sugr_plot_Line_2D(m,'-k','-r',2,40);
0086 axis equal
0087 title('Intersection')