Commit fd8f45d7 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Starting to re-implement parts of the wedge methods. Started with point-on-aperture

parent ad8172ca
function b = point_on_aperture( obj, point )
% Returns true if point is on aperture of the wedge and between start and
% end point of the aperture
dim = size( point );
if dim(1) ~= 3 && dim(2) ~= 3
if numel( point ) ~= 3
error( 'Point must be of dimension 3' );
end
b = zeros( numel(point) / 3, 1 );
norms = sqrt( sum( (point - obj.location).^2, 2 ) );
condition1 = norms < obj.set_get_geo_eps;
if any( condition1 )
b = b | condition1;
end
dir1 = ( point - obj.location ) ./ norms;
dir2 = ( point - obj.aperture_end_point ) ./ sqrt( sum( (point - obj.aperture_end_point).^2, 2 ) );
dir1_norms = sqrt( sum( (dir1 - obj.aperture_direction).^2, 2 ) );
dir2_norms = sqrt( sum( (dir2 + obj.aperture_direction).^2, 2 ) );
condition2 = (dir1_norms < obj.set_get_geo_eps | dir2_norms < obj.set_get_geo_eps) & norms < obj.length;
if any( condition2 )
b = b | condition2;
segment_1 = ( point - obj.aperture_start_point );
segment_2 = ( obj.aperture_end_point - point );
diff_norm = obj.length - norm( segment_1 ) - norm( segment_2 );
if diff_norm < obj.set_get_geo_eps
b = false;
else
b = true;
end
b = all(b);
end
......@@ -25,10 +25,10 @@ if dim_fp(1) ~= 1 && dim_pa(1) ~= 1
error( 'Use same number of field points and points on aperture' );
end
end
if any( ~obj.point_outside_wedge( field_point ) )
if ~obj.point_outside_wedge( field_point )
error( 'Field point must be outside wedge' );
end
if any( ~obj.point_on_aperture( point_on_aperture ) )
if ~obj.point_on_aperture( point_on_aperture )
error( 'No point on aperture found' )
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment