check_hit_circle Function

private function check_hit_circle(this, hitpoint)

Uses

Check if a hitpoint is in the circle

Type Bound

circle_dect

Arguments

Type IntentOptional Attributes Name
class(circle_dect), intent(inout) :: this
type(hit_t), intent(in) :: hitpoint

Hitpoint to check

Return Value logical


Source Code

    logical function check_hit_circle(this, hitpoint)
        !! Check if a hitpoint is in the circle
        
        use geometry, only : intersectCircle

        class(circle_dect), intent(INOUT) :: this
        !> Hitpoint to check
        type(hit_t),        intent(IN)    :: hitpoint
        
        real(kind=wp) :: t 

        check_hit_circle = .false.
        if(this%layer /= hitpoint%layer)return
        check_hit_circle = intersectCircle(this%dir, this%pos, this%radius, hitpoint%pos, hitpoint%dir, t)
        if(check_hit_circle)then
            if(t > 5e-3_wp)check_hit_circle=.false.
        end if
    end function check_hit_circle