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

Fixing problem (self-made) by re-adding acos() to the dot product value of the...

Fixing problem (self-made) by re-adding acos() to the dot product value of the aperture direction and point-on-aperture
parent 76bbe956
......@@ -3,19 +3,19 @@ function alpha_rad = get_angle_from_point_to_aperture( obj, field_point, point_o
%aperture of the wedge.
% output angle alpha: 0 <= alpha <= pi/2
if ~obj.point_outside_wedge( field_point )
error( 'Field point must be outside wedge' );
end
if ~obj.point_on_aperture( point_on_aperture )
error( 'No point on aperture found' )
end
dir_vec = ( point_on_aperture - field_point ) / norm( point_on_aperture - field_point );
alpha_rad =dot( dir_vec, obj.aperture_direction );
alpha_rad = acos( dot( dir_vec, obj.aperture_direction ) );
if alpha_rad > pi/2
alpha_rad = pi - alpha_rad;
end
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