Home > 10-Uncertain-Geometry > Demo-Point-2D > demo_construct_Point_2D.m

demo_construct_Point_2D

PURPOSE ^

demo_construct_Point_2D

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 demo_construct_Point_2D
 demo for constructing points with SUGR

 Wolfgang Förstner
 wfoerstn@uni-bonn.de

 last changes: Susanne Wenzel 06/18
 wenzel@igg.uni-bonn.de

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % demo_construct_Point_2D
0002 % demo for constructing points with SUGR
0003 %
0004 % Wolfgang Förstner
0005 % wfoerstn@uni-bonn.de
0006 %
0007 % last changes: Susanne Wenzel 06/18
0008 % wenzel@igg.uni-bonn.de
0009 
0010 clearvars
0011 close all
0012 clc
0013 
0014 addpath(genpath('../../General-Functions'))
0015 sugr_INIT
0016 ss = plot_init;
0017 
0018 %% intersection
0019 l = sugr_Line_2D(0,1,3*pi/2,0.01,0.02);
0020 sugr_show_Line_2D(l,'l');
0021 m = sugr_Line_2D(1,0,pi/4,.01,0.01);
0022 sugr_show_Line_2D(m,'m');
0023 n = sugr_Line_2D([0,0,1]');
0024 
0025 x = sugr_construct_intersection_Point_2D(l,m);
0026 sugr_show_Point_2D(x,'x');
0027 winkel_lm = sugr_angle_Line_2D(m,l);
0028 % winkel_lm.a*180/pi
0029 winkel_nm = sugr_angle_Line_2D(m,n);
0030 fprintf('\nangle l-m = %5.3f°\tangle n-m = %5.3f°\n',winkel_lm.a*180/pi, winkel_nm.a*180/pi)
0031 
0032 figure('name','intersection of two lines l and m','Color','w','Position',[150,0.28*ss(1),0.3*ss(1) 0.4*ss(2)])
0033 hold on
0034 sugr_plot_Line_2D(l,':r','-r',2,5);
0035 sugr_plot_Line_2D(m,':b','-b',2,5);
0036 sugr_plot_Point_2D(x,'.k','-k',2,5);
0037 axis equal
0038 title('intersection of two lines l and m')
0039 
0040 % return
0041 
0042 %% footpoint x
0043 l = sugr_Line_2D(0,1,2*pi/3,0.01,0.01);
0044 sugr_show_Line_2D(l,'l');
0045 x = sugr_Point_2D(-1,1,0.01,0.01);
0046 sugr_show_Point_2D(x,'x');
0047 
0048 z = sugr_construct_footpoint_xl_Point_2D(x,l);
0049 
0050 figure('name','footpoint x on line l','Color','w','Position',[0.4*ss(1),0.28*ss(1),0.3*ss(1) 0.4*ss(2)])
0051 sugr_plot_Line_2D(l,'-r','-r',2,5);
0052 sugr_plot_Point_2D(x,'-b','-b',2,5);
0053 sugr_plot_Point_2D(z,'.k','-k',2,5);
0054 axis equal
0055 title('footpoint x on line l')
0056 %
0057 
0058 %% midpoint of x and y
0059 x = sugr_Point_2D(0.1*[-1;0],0.00001*[0.7, 1;1,2]);
0060 sugr_show_Point_2D(x,'x');
0061 y = sugr_Point_2D(0.1*[+1;0],0.00001*[0.7,-1;-1,2]);
0062 sugr_show_Point_2D(y,'y');
0063 
0064 z = sugr_construct_midpoint_Point_2D(x,y);
0065 figure('name','midpoint of x and y','Color','w','Position',[0.3*ss(1),50,0.3*ss(1) 0.4*ss(2)])
0066 sugr_plot_Point_2D(x,'.r','-r',2,5);
0067 sugr_plot_Point_2D(y,'.b','-b',2,5);
0068 sugr_plot_Point_2D(z,'.k','-y',2,5);
0069 axis equal
0070 title('midpoint and meanpoint of x and y')
0071 %
0072 
0073 % mean point
0074 zm = sugr_construct_mean_Point_2D(x,y);
0075 sugr_show_Point_2D(zm,'zm')
0076 sugr_plot_Point_2D(zm,'.k','-k',2,5);
0077 
0078 
0079 %% footpoint x from O to l
0080 l = sugr_Line_2D(0,1,2*pi/3,0.03,0.03);
0081 sugr_show_Line_2D(l,'l');
0082 x = sugr_Point_2D(0,0,10^(-3),10^(-3));
0083 sugr_show_Point_2D(x,'x');
0084 
0085 z = sugr_construct_footpoint_Ol_Point_2D(l);
0086 figure('name','footpoint x from O to l','Color','w','Position',[0.65*ss(1),50,0.3*ss(1) 0.4*ss(2)])
0087 sugr_plot_Line_2D(l,'-r','-r',2,5);
0088 sugr_plot_Point_2D(x,'-b','-b',4,5);
0089 sugr_plot_Point_2D(z,'.k','-k',2,5);
0090 title('footpoint x from O to l')
0091 axis equal

Generated on Sat 21-Jul-2018 20:56:10 by m2html © 2005