perpendicular Function

private pure function perpendicular(v1, v2) result(is_parallel)

Returns true if the two vectors are perpendicular.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(:) :: v1
real(kind=wp), intent(in), dimension(:) :: v2

Return Value logical


Calls

proc~~perpendicular~~CallsGraph proc~perpendicular perpendicular proc~unit unit proc~perpendicular->proc~unit

Called by

proc~~perpendicular~~CalledByGraph proc~perpendicular perpendicular proc~generate_circle stl_file%generate_circle proc~generate_circle->proc~perpendicular proc~add_cone stl_file%add_cone proc~add_cone->proc~generate_circle proc~add_cylinder stl_file%add_cylinder proc~add_cylinder->proc~generate_circle proc~add_arrow stl_file%add_arrow proc~add_arrow->proc~add_cone proc~add_arrow->proc~add_cylinder proc~add_curve stl_file%add_curve proc~add_curve->proc~add_cylinder proc~add_axes stl_file%add_axes proc~add_axes->proc~add_arrow

Source Code

    pure function perpendicular(v1, v2) result(is_parallel)

    implicit none

    real(wp),dimension(:),intent(in) :: v1
    real(wp),dimension(:),intent(in) :: v2
    logical :: is_parallel

    real(wp),parameter :: tol = 10.0_wp * epsilon(1.0_wp) !! tolerance

    is_parallel = abs(dot_product(unit(v1), unit(v2))) <= tol

    end function perpendicular