0001
0002
0003
0004
0005
0006
0007
0008
0009 clc
0010 close all
0011 clearvars
0012
0013 addpath(genpath('../General-Functions'))
0014
0015
0016 fprintf('\n------ DEMO 3D projective geometry ------\n')
0017
0018 fprintf('\nIn order to shorten the output, we display transposed vectors\n')
0019 fprintf('\nGiven: 3D points\n')
0020 X1 = [1,1,2,1]'; disp(['X_1 = [', num2str(X1'),']']);
0021 X2 = [0,2,3,1]'; disp(['X_2 = [', num2str(X2'),']']);
0022 X3 = [0,1,3,1]'; disp(['X_3 = [', num2str(X3'),']']);
0023 X4 = [1,2,3,1]'; disp(['X_4 = [', num2str(X4'),']']);
0024
0025 fprintf('\nLine L_2 = X_3 ^ X_1 \n')
0026 L2 = calc_Pi(X3)*X1; disp(['L_2 = [', num2str(L2'),']'])
0027
0028 fprintf('\nPlane A_4 = L_2 ^ X_2 \n')
0029 A4 = calc_Gammadual(L2)*X2; disp(['A_4 = [', num2str(A4'),']'])
0030
0031 fprintf('\nGiven: Planes\n')
0032 fprintf('A_1 parallel to XY-plane\n')
0033 A1 = [0,0,-1,3]'; disp(['A_1 = [', num2str(A1'),']'])
0034 fprintf('\nA_z = XY-plane\n')
0035 Az=[0,0,1,0]'; disp(['A_z = [', num2str(Az'),']'])
0036
0037 fprintf('\nIntersection L_iz = A_1 cap A_z\n')
0038 fprintf('\nLine at infinity perpendicular to Z-axis\n')
0039 Linf_z = calc_Pidual(A1)*Az; disp(['Linf_z = [', num2str(Linf_z'),']'])