Home > 10-Uncertain-Geometry > Demo-Line-2D > demo_sugr_Line_2D.m

demo_sugr_Line_2D

PURPOSE ^

demo_sugr_Line_2D: demo routine for creating a 2D lines

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 demo_sugr_Line_2D: demo routine for creating a 2D lines

 Line_2D = structure

 *           .h = spherically normalized homogeneous coordinates
 *           .Crr = reduced covariance matrix of l.h
 *           .type = 2

 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_sugr_Line_2D: demo routine for creating a 2D lines
0002 %
0003 % Line_2D = structure
0004 %
0005 % *           .h = spherically normalized homogeneous coordinates
0006 % *           .Crr = reduced covariance matrix of l.h
0007 % *           .type = 2
0008 %
0009 % Wolfgang Förstner
0010 % wfoerstn@uni-bonn.de
0011 %
0012 % last changes: Susanne Wenzel 06/18
0013 % wenzel@igg.uni-bonn.de
0014 
0015 
0016 % clear all
0017 clearvars
0018 close all
0019 clc
0020 
0021 addpath(genpath('../../General-Functions'))
0022 %% initialize sugr
0023 sugr_INIT
0024 
0025 ss = plot_init;
0026 
0027 %% (1) line through origin with Hessian parameter vector, CovM == 0
0028 in = [atan2(4,3),0]';
0029 l = sugr_Line_2D(in);
0030 sugr_show_Line_2D(l,'l');
0031 
0032 %% (1) line with Hessian parameters, CovM == 0
0033 in = [3/5,4/5,-5]';
0034 l = sugr_Line_2D(in);
0035 sugr_show_Line_2D(l,'l');
0036 
0037 %% (2) line with Hessian parameters,, CovM == 0
0038 in1 = atan2(4,3);
0039 in2 = 5;
0040 l = sugr_Line_2D(in1,in2);
0041 sugr_show_Line_2D(l,'l');
0042 
0043 %% (2) line with Hessian parameter vector
0044 in1 = [atan2(4,3),5]';
0045 in2 = [0.0002 0.001;0.001 0.01]*0.01';
0046 l = sugr_Line_2D(in1,in2);
0047 sugr_show_Line_2D(l,'l');
0048 
0049 figure('Color','w','Position',[50,100,0.45*ss(1),0.45*ss(1)]);
0050 sugr_plot_Line_2D(l,'-b','-b',2,20);
0051 title('line with Hessian parameter vector')
0052 axis equal
0053 % xlim([-4,10]);ylim([-1,10]);
0054 
0055 %% (2) line with homogeneous coordinate vector
0056 in1 = [0.1177,0.1569,-0.9806]';
0057 in2 = 10^(-4)*[0.1714    0.0521    0.0289;...
0058     0.0521    0.0477    0.0139;...
0059     0.0289    0.0139    0.0057]';
0060 l = sugr_Line_2D(in1,in2);
0061 sugr_show_Line_2D(l,'l');
0062 
0063 %% (2) line at infinity with homogeneous coordinate vector
0064 in1 = [0 0 2]';
0065 in2 = 10^(-4)*[0.1714    0.0521    0.0289;...
0066     0.0521    0.0477    0.0139;...
0067     0.0289    0.0139    0.0057]';
0068 l = sugr_Line_2D(in1,in2);
0069 sugr_show_Line_2D(l,'l');
0070 
0071 %% (3) line with homogeneous coordinates, CovM == 0
0072 in1 = 0.1177;
0073 in2 = 0.1569;
0074 in3 = -0.9806;
0075 l = sugr_Line_2D(in1,in2,in3);
0076 sugr_show_Line_2D(l,'l');
0077 
0078 %% (3) line with Hessian parameters
0079 in1 = atan2(4,3);
0080 in2 = 5;
0081 in3 = [0.0002 0.001;0.001 0.01]';
0082 l = sugr_Line_2D(in1,in2,in3);
0083 sugr_show_Line_2D(l,'l');
0084 
0085 %% (4) line with homogeneous coordinates
0086 in1 = 0.1177;
0087 in2 = 0.1569;
0088 in3 = -0.9806;
0089 in4 = 10^(-4)*[0.1714    0.0521    0.0289;...
0090    0.0521    0.0477    0.0139;...
0091    0.0289    0.0139    0.0057]';
0092 l = sugr_Line_2D(in1,in2,in3,in4);
0093 sugr_show_Line_2D(l,'l');
0094 
0095 %% (5) line with centroid coordinates, CpvM == 0
0096 in1 = -1;
0097 in2 = 7;
0098 in3 = atan2(4,3);
0099 in4 = 0.0141;
0100 in5 = 0.0707;
0101 l = sugr_Line_2D(in1,in2,in3,in4,in5);
0102 sugr_show_Line_2D(l,'l');
0103 
0104 figure('Color','w','Position',[0.55*ss(1),100,0.45*ss(1),0.45*ss(1)]);
0105 sugr_plot_Line_2D(l,':r','-r',2,5);
0106 title('line with centroid coordinates, CpvM == 0')
0107 axis equal
0108 % xlim([-4,8]);ylim([-1,8]);

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