angle_between Function

private elemental function angle_between(va_x, va_y, vb_x, vb_y) result(angle)

Compute the angle between to vectors (they should not both be the 0 vector).

This function uses the crossproduct and arctan to find the angle between two 2D vectors. It takes the four components of the vectors as scalar arguments to allow vectorized evaluation of multiple vector pairs at once. If one of the vectors is zero, the returned angle is also zero. Also multiplicities of Pi are ignored and a 0 angle will be returned for them.

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: va_x

The first vector va

real(kind=rk), intent(in) :: va_y

The first vector va

real(kind=rk), intent(in) :: vb_x

The second vector vb

real(kind=rk), intent(in) :: vb_y

The second vector vb

Return Value real(kind=rk)

The angle betweend va and vb


Called by

proc~~angle_between~~CalledByGraph proc~angle_between angle_between proc~tem_polygon_material_test_angle tem_polygon_material_test_angle proc~tem_polygon_material_test_angle->proc~angle_between proc~tem_polygon_material_value tem_polygon_material_value proc~tem_polygon_material_value->proc~angle_between proc~tem_eval_polygon_material_scal tem_eval_polygon_material_scal proc~tem_eval_polygon_material_scal->proc~tem_polygon_material_value proc~tem_eval_polygon_material_3d tem_eval_polygon_material_3d proc~tem_eval_polygon_material_3d->proc~tem_polygon_material_value proc~tem_eval_polygon_material_scal_3d tem_eval_polygon_material_scal_3d proc~tem_eval_polygon_material_scal_3d->proc~tem_polygon_material_value proc~tem_polygon_material_movement_single tem_polygon_material_movement_single proc~tem_polygon_material_movement_single->proc~tem_polygon_material_value program~tem_polygon_material_test tem_polygon_material_test program~tem_polygon_material_test->proc~tem_polygon_material_test_angle proc~tem_polygon_material_test_value tem_polygon_material_test_value program~tem_polygon_material_test->proc~tem_polygon_material_test_value proc~tem_polygon_material_test_value->proc~tem_polygon_material_value proc~tem_eval_polygon_material tem_eval_polygon_material proc~tem_eval_polygon_material->proc~tem_polygon_material_value proc~tem_polygon_material_movement_multi tem_polygon_material_movement_multi proc~tem_polygon_material_movement_multi->proc~tem_polygon_material_value proc~tem_spatial_vector_for_coord tem_spatial_vector_for_coord proc~tem_spatial_vector_for_coord->proc~tem_eval_polygon_material_3d proc~tem_spatial_vector_for_coord->proc~tem_eval_polygon_material proc~tem_spacetime_for_coord tem_spacetime_for_coord proc~tem_spacetime_for_coord->proc~tem_polygon_material_movement_single proc~tem_spacetime_for_coord->proc~tem_polygon_material_movement_multi proc~tem_spatial_for_coord tem_spatial_for_coord proc~tem_spatial_for_coord->proc~tem_eval_polygon_material_scal proc~tem_spatial_for_coord->proc~tem_eval_polygon_material_scal_3d proc~tem_spacetime_scalar_for_index tem_spacetime_scalar_for_index proc~tem_spacetime_scalar_for_index->proc~tem_spacetime_for_coord proc~tem_spacetime_for_stcoord tem_spacetime_for_stcoord proc~tem_spacetime_for_stcoord->proc~tem_spacetime_for_coord interface~tem_spacetime_for tem_spacetime_for interface~tem_spacetime_for->proc~tem_spacetime_for_coord interface~tem_spatial_for tem_spatial_for interface~tem_spatial_for->proc~tem_spatial_vector_for_coord interface~tem_spatial_for->proc~tem_spatial_for_coord proc~tem_spatial_scalar_for_index tem_spatial_scalar_for_index proc~tem_spatial_scalar_for_index->proc~tem_spatial_for_coord proc~tem_spatial_vector_for_index tem_spatial_vector_for_index proc~tem_spatial_vector_for_index->proc~tem_spatial_vector_for_coord

Contents

None